This reverts commit c52e809b5674f36e38bf83f07568dbf04f7921d4.
This commit is contained in:
parent
c52e809b56
commit
1bf41a92a1
26
start.js
26
start.js
@ -1,12 +1,26 @@
|
|||||||
const exec = require("@actions/exec");
|
const spawn = require('child_process').spawn;
|
||||||
const path = require("path");
|
const path = require("path");
|
||||||
|
|
||||||
|
const exec = (cmd, args=[]) => new Promise((resolve, reject) => {
|
||||||
|
console.log(`Started: ${cmd} ${args.join(" ")}`)
|
||||||
|
const app = spawn(cmd, args, { stdio: 'inherit' });
|
||||||
|
app.on('close', code => {
|
||||||
|
if(code !== 0){
|
||||||
|
err = new Error(`Invalid status code: ${code}`);
|
||||||
|
err.code = code;
|
||||||
|
return reject(err);
|
||||||
|
};
|
||||||
|
return resolve(code);
|
||||||
|
});
|
||||||
|
app.on('error', reject);
|
||||||
|
});
|
||||||
|
|
||||||
const main = async () => {
|
const main = async () => {
|
||||||
await exec(path.join(__dirname, "./start.sh"));
|
await exec('bash', [path.join(__dirname, './start.sh')]);
|
||||||
};
|
};
|
||||||
|
|
||||||
main().catch(err => {
|
main().catch(err => {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
console.error(err.stack);
|
console.error(err.stack);
|
||||||
process.exit(err.code || -1);
|
process.exit(err.code || -1);
|
||||||
});
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user