@@ -79,9 +79,10 @@ packages.forEach((packageName) => {
7979 const npmOptions = {
8080 cwd : path . resolve ( argv . packagesDir , packageName )
8181 } ;
82+ const runArgs = [ ...npmArgs , path . resolve ( argv . packagesDir , packageName ) ] ;
8283 if ( argv . debug ) {
8384 /* eslint-disable no-console */
84- console . log ( 'running npm with args' , npmArgs , 'options ' , npmOptions ) ;
85+ console . log ( 'running npm with args' , runArgs , 'options ' , npmOptions ) ;
8586 /* eslint-enable no-console */
8687 }
8788 if ( argv . dryRun ) {
@@ -90,7 +91,7 @@ packages.forEach((packageName) => {
9091 } else {
9192 execFile (
9293 'npm' ,
93- npmArgs ,
94+ runArgs ,
9495 npmOptions ,
9596 ( error , stdout , stderr ) => {
9697 if ( error ) {
@@ -114,12 +115,13 @@ const npmOptions = {
114115} ;
115116const packageJSON = JSON . parse (
116117 fs . readFileSync ( path . resolve ( argv . mainDir , 'package.json' ) ) ) ;
118+ const runArgs = [ ...npmArgs , path . resolve ( argv . mainDir ) ] ;
117119
118120// eslint-disable-next-line no-console
119121console . info ( 'processing' , packageJSON . name ) ;
120122if ( argv . debug ) {
121123 /* eslint-disable no-console */
122- console . log ( 'running npm with args' , npmArgs , 'options ' , npmOptions ) ;
124+ console . log ( 'running npm with args' , runArgs , 'options ' , npmOptions ) ;
123125 /* eslint-enable no-console */
124126}
125127if ( argv . dryRun ) {
@@ -128,7 +130,7 @@ if (argv.dryRun) {
128130} else {
129131 execFile (
130132 'npm' ,
131- npmArgs ,
133+ runArgs ,
132134 npmOptions ,
133135 ( error , stdout , stderr ) => {
134136 if ( error ) {
0 commit comments