1- const { execSync } = require ( 'child_process' ) ;
1+ const { execFileSync } = require ( 'child_process' ) ;
22const path = require ( 'path' ) ;
33const fs = require ( 'fs' ) ;
44const readline = require ( 'readline' ) ;
@@ -25,10 +25,10 @@ try {
2525 }
2626
2727 console . log ( `---- Building angular-sdk-components at: ${ componentsProjectPath } ----` ) ;
28- execSync ( `cd ${ componentsProjectPath } && ng build angular-sdk-components` , { stdio : 'inherit' } ) ;
28+ execFileSync ( 'ng' , [ ' build' , ' angular-sdk-components' ] , { cwd : componentsProjectPath , stdio : 'inherit' } ) ;
2929
3030 console . log ( `---- Packing npm package in: ${ distDir } ----` ) ;
31- execSync ( `cd ${ distDir } && npm pack` , { stdio : 'inherit' } ) ;
31+ execFileSync ( ' npm' , [ ' pack' ] , { cwd : distDir , stdio : 'inherit' } ) ;
3232
3333 // Find the generated .tgz file
3434 const tgzFile = fs . readdirSync ( distDir ) . find ( file => file . endsWith ( '.tgz' ) ) ;
5050 fs . copyFileSync ( tgzPath , targetPath ) ;
5151
5252 console . log ( '---- Installing package in angular-sdk ----' ) ;
53- execSync ( `cd ${ angularSdkPath } && npm install ./${ tgzFile } `, { stdio : 'inherit' } ) ;
53+ execFileSync ( ' npm' , [ ' install' , ` ./${ tgzFile } `] , { cwd : angularSdkPath , stdio : 'inherit' } ) ;
5454 console . log ( "Done!!! 'angular-sdk' now uses local build of angular-sdk-components." ) ;
5555 } ) ;
5656} catch ( error ) {
0 commit comments