@@ -21,16 +21,16 @@ if (debug) {
2121
2222/**
2323 * @param {string } command
24- * @param {string } cwd
24+ * @param {import("child_process").SpawnSyncOptions } options
2525 * @returns {ReturnType<typeof _spawnSync> }
2626 */
27- function spawnSync ( command , cwd ) {
27+ function spawnSync ( command , options ) {
2828 if ( debug ) {
29- console . debug ( `Spawning shell to run command " $ {command } " ` ) ;
29+ console . debug ( `Spawning process to run command: $ $ {command } ` ) ;
3030 }
3131
3232 const [ cmd , ...args ] = command . split ( ' ' ) ;
33- const ret = _spawnSync ( cmd , args , { cwd , stdio : 'inherit' } ) ;
33+ const ret = _spawnSync ( cmd , args , { stdio : 'inherit' , ... options } ) ;
3434
3535 if ( ret . status ) {
3636 console . error ( ret ) ;
@@ -49,12 +49,12 @@ function spawnSync(command, cwd) {
4949function execSync ( command , options ) {
5050 try {
5151 if ( debug ) {
52- console . debug ( `Running command " $ {command } " .` ) ;
52+ console . debug ( `Running command: $ $ {command } .` ) ;
5353 }
5454
5555 return _execSync ( command , options ) ;
5656 } catch ( e ) {
57- console . error ( `Failed to run command " $ {command } " ` , e ) ;
57+ console . error ( `Failed to run command: $ $ {command } ` , e ) ;
5858 throw e ;
5959 }
6060}
@@ -211,14 +211,14 @@ async function run() {
211211 console . log ( ' New Version:' , newVersion ) ;
212212
213213 if ( pkg ?. scripts ?. publish ) {
214- spawnSync ( `npm run publish` , deployDir ) ;
214+ spawnSync ( `npm run publish` , { cwd : deployDir } ) ;
215215 } else {
216216 const verbose = debug ? ' --verbose' : '' ;
217- spawnSync ( `npm publish --access=${ access } ${ verbose } ` , deployDir ) ;
217+ spawnSync ( `npm publish --access=${ access } ${ verbose } ` , { cwd : deployDir } ) ;
218218 }
219219
220220 spawnSync ( 'git restore .' ) ; // Cleanup changes in the git workspace
221- spawnSync ( `echo "version=${ newVersion } " >> $GITHUB_OUTPUT` ) ;
221+ spawnSync ( `echo "version=${ newVersion } " >> " $GITHUB_OUTPUT"` , { shell : true } ) ;
222222
223223 if ( disableGitTag ) {
224224 console . log ( 'Git tagging disabled... Skipping' ) ;
0 commit comments