bashjs
v1.0.10
Published
JavaScript wrapper for Bash
Downloads
5
Readme
const BashJS = require('bashjs');
const bashjs = new BashJS({
cwd: './',
console: false,
log: null,
cleanLog: false,
sysLog: false,
});
bashjs.execScript(
function* (cfg) {
let data = null;
yield `git checkout ${cfg.branch}`;
yield `npm install`;
yield `npm test`;
const rev = yield `git rev-parse --verify HEAD`;
console.log(`GIT-REV = ${rev}`);
yield `aws s3 ls`;
yield `ssh-keygen -F github.com`;
data = (yield `ssh-keyscan github.com`).join('');
console.log(data);
},
{
branch: 'develop'
}
)
.then(() => console.log('ok'))
.catch(console.log);
######Dev Links
- https://medium.freecodecamp.org/node-js-child-processes-everything-you-need-to-know-e69498fe970a