Skip to content

Commit

Permalink
Merge pull request #31 from ad-m/fix-start-sh
Browse files Browse the repository at this point in the history
Fix start.sh path
  • Loading branch information
ad-m authored Nov 13, 2019
2 parents 1a31adf + 48c9f78 commit 02b0b75
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions start.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
const spawn = require('child_process').spawn;
const path = require("path");

const main = () => new Promise((resolve, reject) => {
const ssh = spawn('bash', ['start.sh'], { stdio: 'inherit' });
ssh.on('close', resolve);
ssh.on('error', reject);
const exec = (cmd, args=[]) => new Promise((resolve, reject) => {
console.log(`Started: ${cmd} ${args.join(" ")}`)
const app = spawn(cmd, args, { stdio: 'inherit' });
app.on('close', resolve);
app.on('error', reject);
});

const main = async () => {
await exec('bash', [path.join(__dirname, './start.sh')]);
};

main().catch(err => {
console.err(err);
console.err(err.stack);
console.error(err);
console.error(err.stack);
process.exit(-1);
})

0 comments on commit 02b0b75

Please sign in to comment.