@@ -15,14 +15,14 @@ export const OTHER = 0;
15
15
/** Executes a command and returns stdout. */
16
16
export function exec ( cmd , args = [ ] , options = { } ) {
17
17
const res = spawnSync ( cmd , args , options ) ;
18
- if ( res . status != 0 ) throw Error ( `command '${ cmd } ${ args . join ( " " ) } ' failed with code ${ res . status } : ${ res . stderr . toString ( ) } ` ) ;
18
+ if ( res . status != 0 ) throw Error ( `command '${ cmd } ' failed with code ${ res . status } : ${ res . stderr . toString ( ) } ` ) ;
19
19
return res . stdout . toString ( ) . trim ( ) ;
20
20
}
21
21
22
22
/** Just runs a command. */
23
23
export function run ( cmd , args = [ ] ) {
24
24
const res = spawnSync ( cmd , args , { stdio : "inherit" } ) ;
25
- if ( res . status != 0 ) throw Error ( `command '${ cmd } ${ args . join ( " " ) } ' failed with code ${ res . status } ` ) ;
25
+ if ( res . status != 0 ) throw Error ( `command '${ cmd } ' failed with code ${ res . status } ` ) ;
26
26
}
27
27
28
28
/** Gets existing versions sorted from newest to oldest. */
@@ -248,7 +248,7 @@ export function publishRelease(nextVersion, commit, notes) {
248
248
/** Publishes the package to npm. */
249
249
export function publishPackage ( version ) {
250
250
const token = getNpmToken ( ) ;
251
- run ( "npm" , [ "version" , version ] ) ;
252
- run ( "npm" , [ "npm" , " config", "set" , `//registry.npmjs.org/:_authToken=${ token } ` ] ) ;
251
+ run ( "npm" , [ "version" , version , "--no-git-tag-version" ] ) ;
252
+ run ( "npm" , [ "config" , "set" , `//registry.npmjs.org/:_authToken=${ token } ` ] ) ;
253
253
run ( "npm" , [ "publish" , "--access" , "public" ] ) ;
254
254
}
0 commit comments