Skip to content

Commit 48c9f78

Browse files
committed
Fix start.sh path
1 parent 1a31adf commit 48c9f78

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

start.js

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
11
const spawn = require('child_process').spawn;
2+
const path = require("path");
23

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

11+
const main = async () => {
12+
await exec('bash', [path.join(__dirname, './start.sh')]);
13+
};
14+
915
main().catch(err => {
10-
console.err(err);
11-
console.err(err.stack);
16+
console.error(err);
17+
console.error(err.stack);
1218
process.exit(-1);
1319
})

0 commit comments

Comments
 (0)