We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1a31adf commit 48c9f78Copy full SHA for 48c9f78
1 file changed
start.js
@@ -1,13 +1,19 @@
1
const spawn = require('child_process').spawn;
2
+const path = require("path");
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);
+const exec = (cmd, args=[]) => new Promise((resolve, reject) => {
+ console.log(`Started: ${cmd} ${args.join(" ")}`)
+ const app = spawn(cmd, args, { stdio: 'inherit' });
7
+ app.on('close', resolve);
8
+ app.on('error', reject);
9
});
10
11
+const main = async () => {
12
+ await exec('bash', [path.join(__dirname, './start.sh')]);
13
+};
14
+
15
main().catch(err => {
- console.err(err);
- console.err(err.stack);
16
+ console.error(err);
17
+ console.error(err.stack);
18
process.exit(-1);
19
})
0 commit comments