Skip to content

Commit a258207

Browse files
authored
Fix nightly release job (facebook#28824)
1 parent 608edcc commit a258207

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

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

Lines changed: 5 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,9 @@ 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', ['view', `${packageName}@${version}`]);
21+
const packageExists = status === 0;
22+
if (!packageExists) {
2123
console.log(
2224
theme`{package ${packageName}} {version ${version}} has already been published.`
2325
);

0 commit comments

Comments
 (0)