+8
-2
@@ -9,7 +9,9 @@ const os = require('os');
|
|||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
|
||||||
// Setup auth
|
// Setup auth
|
||||||
fs.writeFileSync(`${process.env['HOME']}/.npmrc`, `//registry.npmjs.org/:_authToken=${process.env['NPM_AUTH_TOKEN']}`);
|
if (process.env['NPM_AUTH_TOKEN']) {
|
||||||
|
fs.writeFileSync(`${process.env['HOME']}/.npmrc`, `//registry.npmjs.org/:_authToken=${process.env['NPM_AUTH_TOKEN']}`);
|
||||||
|
}
|
||||||
|
|
||||||
const isDryRun = process.argv.includes('--dry');
|
const isDryRun = process.argv.includes('--dry');
|
||||||
if (isDryRun) {
|
if (isDryRun) {
|
||||||
@@ -118,7 +120,11 @@ function asArray(value) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getPublishedVersions(packageJson, version, tag) {
|
function getPublishedVersions(packageJson, version, tag) {
|
||||||
const versionsProcess = cp.spawnSync(os.platform === 'win32' ? 'npm.cmd' : 'npm', ['view', packageJson.name, 'versions', '--json']);
|
const versionsProcess = cp.spawnSync(
|
||||||
|
os.platform === 'win32' ? 'npm.cmd' : 'npm',
|
||||||
|
['view', packageJson.name, 'versions', '--json'],
|
||||||
|
{ shell: true }
|
||||||
|
);
|
||||||
if (versionsProcess.stdout.length === 0 && versionsProcess.stderr) {
|
if (versionsProcess.stdout.length === 0 && versionsProcess.stderr) {
|
||||||
const err = versionsProcess.stderr.toString();
|
const err = versionsProcess.stderr.toString();
|
||||||
if (err.indexOf('404 Not Found - GET https://registry.npmjs.org/@xterm') > 0) {
|
if (err.indexOf('404 Not Found - GET https://registry.npmjs.org/@xterm') > 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user