Skip to content

Commit 4332b91

Browse files
committed
chore(misc): cleanup
1 parent 4876bb3 commit 4332b91

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

packages/js/src/executors/release-publish/release-publish.impl.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -224,14 +224,10 @@ Please update the local dependency on "${depName}" to be a valid semantic versio
224224
windowsHide: true,
225225
});
226226

227-
// `npm view`/`bun info` can exit 0 with empty stdout when the package
228-
// exists in the registry but has no published versions or dist-tags yet
229-
// (observed with GitHub Packages). Treat empty output the same as the
230-
// package not existing yet and continue to the publish step, rather than
231-
// letting `JSON.parse('')` throw "Unexpected end of JSON input" and get
232-
// surfaced as an unexpected dist-tag failure. See nrwl/nx#36358.
233-
const resultStr = result.toString().trim();
234-
const resultJson = resultStr ? JSON.parse(resultStr) : {};
227+
// `npm view`/`bun info` can exit 0 with empty stdout when the package exists in the registry but has
228+
// no published versions or dist-tags yet (e.g. GitHub packages). Treat empty output the samme as
229+
// package not existing yet and continue to the publish step.
230+
const resultJson = JSON.parse(result.toString().trim() || '{}');
235231
const distTags = resultJson['dist-tags'] || {};
236232
if (distTags[tag] === currentVersion) {
237233
console.warn(

0 commit comments

Comments
 (0)