generated from actions/javascript-action
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
change to use trial version by default
- Loading branch information
1 parent
7d4dd37
commit b67e200
Showing
10 changed files
with
149 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -104,3 +104,6 @@ __tests__/runner/* | |
|
||
# Custom | ||
encrypted | ||
eval_linux | ||
ioncube_encoder_evaluation | ||
ioncube_encoder_evaluation.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,29 @@ | ||
const core = require('@actions/core') | ||
const EVALUATION_PATH = './ioncube_encoder_evaluation/ioncube_encoder.sh' | ||
const tar = require('tar') | ||
const fs = require('fs') | ||
const cp = require('child_process') | ||
const process = require('process') | ||
|
||
/** | ||
* Download ioncube evaluation. | ||
* @returns {string} Returns the path of encoder. | ||
* @returns {Promise<string>} Returns the path of encoder. | ||
*/ | ||
async function evaluation() { | ||
core.debug('Using trial ioncube to encode files!') | ||
core.debug('Downloading trial version of ioncube encoder...') | ||
module.exports = async function evaluation() { | ||
const cwd = process.cwd() | ||
|
||
// TODO: download ioncube evaluation | ||
// wget https://www.ioncube.com/eval_linux -O ioncube_encoder_evaluation.tar.gz | ||
// tar -xzvf ioncube_encoder_evaluation.tar.gz | ||
if (!fs.existsSync('ioncube_encoder_evaluation')) { | ||
await download('https://www.ioncube.com/eval_linux', `${cwd}/ioncube_encoder_evaluation.tar.gz`) | ||
await tar.extract({ file: `${cwd}/ioncube_encoder_evaluation.tar.gz` }) | ||
|
||
if (fs.existsSync(`${cwd}/ioncube_encoder_evaluation.tar.gz`)) { | ||
fs.unlinkSync(`${cwd}/ioncube_encoder_evaluation.tar.gz`) | ||
} | ||
} | ||
|
||
return EVALUATION_PATH | ||
} | ||
|
||
module.exports = { | ||
EVALUATION_PATH, | ||
evaluation | ||
const download = async (uri, filename) => { | ||
cp.execSync(`wget ${uri} -O ${filename}`) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters