Merge pull request #31 from ad-m/fix-start-sh

Fix start.sh path
This commit is contained in:
Adam Dobrawy 2019-11-13 03:53:21 +01:00 committed by GitHub
commit 02b0b75d44
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,13 +1,19 @@
const spawn = require('child_process').spawn; const spawn = require('child_process').spawn;
const path = require("path");
const main = () => new Promise((resolve, reject) => { const exec = (cmd, args=[]) => new Promise((resolve, reject) => {
const ssh = spawn('bash', ['start.sh'], { stdio: 'inherit' }); console.log(`Started: ${cmd} ${args.join(" ")}`)
ssh.on('close', resolve); const app = spawn(cmd, args, { stdio: 'inherit' });
ssh.on('error', reject); app.on('close', resolve);
app.on('error', reject);
}); });
const main = async () => {
await exec('bash', [path.join(__dirname, './start.sh')]);
};
main().catch(err => { main().catch(err => {
console.err(err); console.error(err);
console.err(err.stack); console.error(err.stack);
process.exit(-1); process.exit(-1);
}) })