chore: support otp (#14154)
This commit is contained in:
parent
aca2293fa9
commit
966d776c18
1 changed files with 6 additions and 1 deletions
|
@ -7,6 +7,11 @@ const request = require('request')
|
||||||
const assert = require('assert')
|
const assert = require('assert')
|
||||||
const rootPackageJson = require('../package.json')
|
const rootPackageJson = require('../package.json')
|
||||||
|
|
||||||
|
if (!process.env.ELECTRON_NPM_OTP) {
|
||||||
|
console.error('Please set ELECTRON_NPM_OTP')
|
||||||
|
process.exit(1)
|
||||||
|
}
|
||||||
|
|
||||||
const github = new GitHubApi({
|
const github = new GitHubApi({
|
||||||
// debug: true,
|
// debug: true,
|
||||||
headers: { 'User-Agent': 'electron-npm-publisher' },
|
headers: { 'User-Agent': 'electron-npm-publisher' },
|
||||||
|
@ -120,7 +125,7 @@ new Promise((resolve, reject) => {
|
||||||
resolve(tarballPath)
|
resolve(tarballPath)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
.then((tarballPath) => childProcess.execSync(`npm publish ${tarballPath} --tag ${npmTag}`))
|
.then((tarballPath) => childProcess.execSync(`npm publish ${tarballPath} --tag ${npmTag} --otp=${process.env.ELECTRON_NPM_OTP}`))
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.error(`Error: ${err}`)
|
console.error(`Error: ${err}`)
|
||||||
process.exit(1)
|
process.exit(1)
|
||||||
|
|
Loading…
Reference in a new issue