index.js
function promiseCommand(command) {
    const opts = {
        env: process.env
    };
    console.log('>>>>', command)
    return spawnShell(command, opts).exitPromise
        .then((exitCode) => {
            if (exitCode === 0) {
                return;
            } else {
                throw Error("Exit " + exitCode)
            }
        })
}
function promiseCommand(command) {
    const opts = {
        env: process.env
    };
    console.log('>>>>', command)
    return spawnShell(command, opts).exitPromise
        .then((exitCode) => {
            if (exitCode === 0) {
                return;
            } else {
                throw Error("Exit " + exitCode)
            }
        })
}
function promiseCommand ( command ) { const opts = { env : process . env } ; console . log ( '>>>>' , command ) return spawnShell ( command , opts ) . exitPromise . then ( ( exitCode ) => { if ( exitCode === 0 ) { return ; } else { throw Error ( "Exit " + exitCode ) } } ) }
The main purpose of this is to reject the promise based on exit code
The main purpose of this is to reject the promise based on exit code