build/npm.js
function (cwd = process.cwd()) {
        const promise = new Promise((resolve, reject) => {
            const _name = this.toString();
            // eslint-disable-next-line no-console
            console.log(`spawning:: ${_name}`);
            const call = spawn(this.cmd, this.args, {env: process.env, shell: true, stdio: 'inherit', cwd});
            this.args = [];
            call.on('exit', (code) => {
                // eslint-disable-next-line no-console
                console.log(`spawning:: ${_name} code::${code}`);
                if (code === 0) {
                    resolve(0);
                } else {
                    reject(code);
                }
            });
            return call;
        });

        return promise;
    }
function (cwd = process.cwd()) {
        const promise = new Promise((resolve, reject) => {
            const _name = this.toString();
            // eslint-disable-next-line no-console
            console.log(`spawning:: ${_name}`);
            const call = spawn(this.cmd, this.args, {env: process.env, shell: true, stdio: 'inherit', cwd});
            this.args = [];
            call.on('exit', (code) => {
                // eslint-disable-next-line no-console
                console.log(`spawning:: ${_name} code::${code}`);
                if (code === 0) {
                    resolve(0);
                } else {
                    reject(code);
                }
            });
            return call;
        });

        return promise;
    }
function ( cwd = process . cwd ( ) ) { const promise = new Promise ( ( resolve , reject ) => { const _name = this . toString ( ) ; // eslint-disable-next-line no-console console . log ( ` ${ _name } ` ) ; const call = spawn ( this . cmd , this . args , { env : process . env , shell : true , stdio : 'inherit' , cwd } ) ; this . args = [ ] ; call . on ( 'exit' , ( code ) => { // eslint-disable-next-line no-console console . log ( ` ${ _name } ${ code } ` ) ; if ( code === 0 ) { resolve ( 0 ) ; } else { reject ( code ) ; } } ) ; return call ; } ) ; return promise ; }
can override the cwd
can override the cwd