@deployable/run
v0.0.1
Published
run a process
Downloads
1
Readme
Run a process, store it's output, log things
const Promise = require('bluebird')
const {Run, RunRcError, RunError} = require('../run')
function genRunCmd(...cmd){
return function(){
return Run.fullLog(...cmd)
.catch(RunRcError, err => console.error('Bad rc %s', err.results.exit_code))
.catch(RunError, err => console.error('RunError: ', err))
.catch(err => console.error('Error: ', err ))
}
}
genRunCmd('ls')()
.then(genRunCmd('wc','-c','/etc/passwd'))
.then(genRunCmd('ls','-al'))
.then(genRunCmd('ls','whatever'))
.then(genRunCmd('lsa','broke'))
.then(genRunCmd('ls','sp ace', {ignore_rc:true}))