@@ -92,8 +92,8 @@ new Promise((resolve, reject) => {
9292 'user-agent' : 'electron-npm-publisher'
9393 }
9494 } , ( err , response , body ) => {
95- if ( err ) {
96- reject ( err )
95+ if ( err || response . statusCode !== 200 ) {
96+ reject ( err || new Error ( 'Cannot download electron.d.ts' ) )
9797 } else {
9898 fs . writeFileSync ( path . join ( tempDir , 'electron.d.ts' ) , body )
9999 resolve ( release )
@@ -107,7 +107,7 @@ new Promise((resolve, reject) => {
107107. then ( ( ) => childProcess . execSync ( 'npm pack' , { cwd : tempDir } ) )
108108. then ( ( ) => {
109109 // test that the package can install electron prebuilt from github release
110- const tarballPath = path . join ( tempDir , `electron -${ rootPackageJson . version } .tgz` )
110+ const tarballPath = path . join ( tempDir , `${ rootPackageJson . name } -${ rootPackageJson . version } .tgz` )
111111 return new Promise ( ( resolve , reject ) => {
112112 childProcess . execSync ( `npm install ${ tarballPath } --force --silent` , {
113113 env : Object . assign ( { } , process . env , { electron_config_cache : tempDir } ) ,
@@ -119,4 +119,7 @@ new Promise((resolve, reject) => {
119119 } )
120120} )
121121. then ( ( tarballPath ) => childProcess . execSync ( `npm publish ${ tarballPath } --tag ${ npmTag } ` ) )
122- . catch ( ( err ) => console . error ( `Error: ${ err } ` ) )
122+ . catch ( ( err ) => {
123+ console . error ( `Error: ${ err } ` )
124+ process . exit ( 1 )
125+ } )
0 commit comments