@@ -201,25 +201,15 @@ function git (manifests, options) {
201201 *
202202 * @param {string } command - The command to run
203203 * @param {string[] } args - An array of arguments to pass
204- * @param {object } [opts] - Options to pass to spawnSync
205- * @param {boolean } [opts.skipCustomErrorLog] - Use to skip logging the error when using try-catch
206204 */
207- function exec ( command , args , opts ) {
208- opts = opts || { } ;
209- let skipCustomErrorLog = opts . skipCustomErrorLog ;
210- delete opts . skipCustomErrorLog ;
211- // use which to make sure that node spawn can find correct executable, at the moment this is used as
212- // a windows fallback, until https://github.com/libuv/libuv/pull/358 is fixed
213- const which = require ( 'npm-which' ) ( process . cwd ( ) ) ;
214- let pathToCommand = which . sync ( command ) ;
215- let result = spawnSync ( pathToCommand , args , opts ) ;
205+ function exec ( command , args ) {
206+ let result = spawnSync ( command , args ) ;
207+
216208 if ( result . status || result . error ) {
217- if ( ! skipCustomErrorLog ) {
218- console . error (
219- chalk . bold . red ( 'Error running command:' ) ,
220- chalk . reset . magenta ( command , args . join ( ' ' ) )
221- ) ;
222- }
209+ console . error (
210+ chalk . bold . red ( 'Error running command:' ) ,
211+ chalk . reset . magenta ( command , args . join ( ' ' ) )
212+ ) ;
223213
224214 let err = result . error ;
225215 if ( ! result . error ) {
0 commit comments