Skip to content

Commit 34f9cb4

Browse files
committed
Fix nightly release job
1 parent bf09089 commit 34f9cb4

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

scripts/release/publish-commands/publish-to-npm.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22

33
'use strict';
44

5+
const {spawnSync} = require('child_process');
56
const {exec} = require('child-process-promise');
67
const {readJsonSync} = require('fs-extra');
78
const {join} = require('path');
8-
const {confirm, execRead} = require('../utils');
9+
const {confirm} = require('../utils');
910
const theme = require('../theme');
1011

1112
const run = async ({cwd, dry, tags, ci}, packageName, otp) => {
@@ -16,8 +17,13 @@ const run = async ({cwd, dry, tags, ci}, packageName, otp) => {
1617
// If so we might be resuming from a previous run.
1718
// We could infer this by comparing the build-info.json,
1819
// But for now the easiest way is just to ask if this is expected.
19-
const info = await execRead(`npm view ${packageName}@${version}`);
20-
if (info) {
20+
const {status} = spawnSync('npm', [
21+
'view',
22+
`${packageName}@${version}`,
23+
'--json',
24+
]);
25+
const packageExists = status === 0;
26+
if (!packageExists) {
2127
console.log(
2228
theme`{package ${packageName}} {version ${version}} has already been published.`
2329
);

0 commit comments

Comments
 (0)