mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 20:52:56 +01:00
Handle case when npm would return an error code (#3340)
This commit is contained in:
parent
35eb0efbc0
commit
9d4574b10b
2 changed files with 10 additions and 6 deletions
12
.github/workflows/publish/computeState.js
vendored
12
.github/workflows/publish/computeState.js
vendored
|
|
@ -90,10 +90,14 @@ function npmGetLatestVersion(packageName) {
|
|||
* @returns {boolean}
|
||||
*/
|
||||
function npmExists(packageName, version) {
|
||||
const output = cp.execSync(`npm show ${packageName}@${version} version`).toString();
|
||||
const result = output.split(/\r\n|\r|\n/g)[0];
|
||||
if (result.trim().length === 0) {
|
||||
try {
|
||||
const output = cp.execSync(`npm show ${packageName}@${version} version`).toString();
|
||||
const result = output.split(/\r\n|\r|\n/g)[0];
|
||||
if (result.trim().length === 0) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
} catch (err) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue