minor changes as per code review comments
This commit is contained in:
parent
6e86a95f5e
commit
c0f68af458
1 changed files with 7 additions and 4 deletions
|
@ -92,8 +92,8 @@ new Promise((resolve, reject) => {
|
||||||
'user-agent': 'electron-npm-publisher'
|
'user-agent': 'electron-npm-publisher'
|
||||||
}
|
}
|
||||||
}, (err, response, body) => {
|
}, (err, response, body) => {
|
||||||
if (err) {
|
if (err || response.statusCode !== 200) {
|
||||||
reject(err)
|
reject(err || new Error('Cannot download electron.d.ts'))
|
||||||
} else {
|
} else {
|
||||||
fs.writeFileSync(path.join(tempDir, 'electron.d.ts'), body)
|
fs.writeFileSync(path.join(tempDir, 'electron.d.ts'), body)
|
||||||
resolve(release)
|
resolve(release)
|
||||||
|
@ -107,7 +107,7 @@ new Promise((resolve, reject) => {
|
||||||
.then(() => childProcess.execSync('npm pack', { cwd: tempDir }))
|
.then(() => childProcess.execSync('npm pack', { cwd: tempDir }))
|
||||||
.then(() => {
|
.then(() => {
|
||||||
// test that the package can install electron prebuilt from github release
|
// test that the package can install electron prebuilt from github release
|
||||||
const tarballPath = path.join(tempDir, `electron-${rootPackageJson.version}.tgz`)
|
const tarballPath = path.join(tempDir, `${rootPackageJson.name}-${rootPackageJson.version}.tgz`)
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
childProcess.execSync(`npm install ${tarballPath} --force --silent`, {
|
childProcess.execSync(`npm install ${tarballPath} --force --silent`, {
|
||||||
env: Object.assign({}, process.env, { electron_config_cache: tempDir }),
|
env: Object.assign({}, process.env, { electron_config_cache: tempDir }),
|
||||||
|
@ -119,4 +119,7 @@ new Promise((resolve, reject) => {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
.then((tarballPath) => childProcess.execSync(`npm publish ${tarballPath} --tag ${npmTag}`))
|
.then((tarballPath) => childProcess.execSync(`npm publish ${tarballPath} --tag ${npmTag}`))
|
||||||
.catch((err) => console.error(`Error: ${err}`))
|
.catch((err) => {
|
||||||
|
console.error(`Error: ${err}`)
|
||||||
|
process.exit(1)
|
||||||
|
})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue