Skip to content

Commit

Permalink
Use nodejs to start bash
Browse files Browse the repository at this point in the history
  • Loading branch information
ad-m committed Nov 12, 2019
1 parent f08aa34 commit d3c5a1e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
4 changes: 2 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ inputs:
required: false
default: '.'
runs:
using: 'bash'
main: 'start.sh'
using: 'node12'
main: 'start.js'
13 changes: 13 additions & 0 deletions start.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const spawn = require('child_process').spawn;

const main = () => new Promise((resolve, reject) => {
const ssh = spawn('bash', ['start.sh'], { stdio: 'inherit' });
ssh.on('close', resolve);
ssh.on('error', reject);
});

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

0 comments on commit d3c5a1e

Please sign in to comment.