@@ -21,16 +21,16 @@ if (debug) {
21
21
22
22
/**
23
23
* @param {string } command
24
- * @param {string } cwd
24
+ * @param {import("child_process").SpawnSyncOptions } options
25
25
* @returns {ReturnType<typeof _spawnSync> }
26
26
*/
27
- function spawnSync ( command , cwd ) {
27
+ function spawnSync ( command , options ) {
28
28
if ( debug ) {
29
- console . debug ( `Spawning shell to run command " $ {command } " ` ) ;
29
+ console . debug ( `Spawning process to run command: $ $ {command } ` ) ;
30
30
}
31
31
32
32
const [ cmd , ...args ] = command . split ( ' ' ) ;
33
- const ret = _spawnSync ( cmd , args , { cwd , stdio : 'inherit' } ) ;
33
+ const ret = _spawnSync ( cmd , args , { stdio : 'inherit' , ... options } ) ;
34
34
35
35
if ( ret . status ) {
36
36
console . error ( ret ) ;
@@ -49,12 +49,12 @@ function spawnSync(command, cwd) {
49
49
function execSync ( command , options ) {
50
50
try {
51
51
if ( debug ) {
52
- console . debug ( `Running command " $ {command } " .` ) ;
52
+ console . debug ( `Running command: $ $ {command } .` ) ;
53
53
}
54
54
55
55
return _execSync ( command , options ) ;
56
56
} catch ( e ) {
57
- console . error ( `Failed to run command " $ {command } " ` , e ) ;
57
+ console . error ( `Failed to run command: $ $ {command } ` , e ) ;
58
58
throw e ;
59
59
}
60
60
}
@@ -211,14 +211,14 @@ async function run() {
211
211
console . log ( ' New Version:' , newVersion ) ;
212
212
213
213
if ( pkg ?. scripts ?. publish ) {
214
- spawnSync ( `npm run publish` , deployDir ) ;
214
+ spawnSync ( `npm run publish` , { cwd : deployDir } ) ;
215
215
} else {
216
216
const verbose = debug ? ' --verbose' : '' ;
217
- spawnSync ( `npm publish --access=${ access } ${ verbose } ` , deployDir ) ;
217
+ spawnSync ( `npm publish --access=${ access } ${ verbose } ` , { cwd : deployDir } ) ;
218
218
}
219
219
220
220
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 } ) ;
222
222
223
223
if ( disableGitTag ) {
224
224
console . log ( 'Git tagging disabled... Skipping' ) ;
0 commit comments