mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 07:00:11 +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}
|
* @returns {boolean}
|
||||||
*/
|
*/
|
||||||
function npmExists(packageName, version) {
|
function npmExists(packageName, version) {
|
||||||
const output = cp.execSync(`npm show ${packageName}@${version} version`).toString();
|
try {
|
||||||
const result = output.split(/\r\n|\r|\n/g)[0];
|
const output = cp.execSync(`npm show ${packageName}@${version} version`).toString();
|
||||||
if (result.trim().length === 0) {
|
const result = output.split(/\r\n|\r|\n/g)[0];
|
||||||
|
if (result.trim().length === 0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
} catch (err) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
4
package-lock.json
generated
4
package-lock.json
generated
|
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "monaco-editor",
|
"name": "monaco-editor",
|
||||||
"version": "0.33.0",
|
"version": "0.34.0",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "monaco-editor",
|
"name": "monaco-editor",
|
||||||
"version": "0.33.0",
|
"version": "0.34.0",
|
||||||
"hasInstallScript": true,
|
"hasInstallScript": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue