mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 17:25:39 +01:00
Read the latest published version from npm, do not rely on package.json (fixes #2800)
This commit is contained in:
parent
b4f1ca62dd
commit
1f9655af22
1 changed files with 2 additions and 3 deletions
|
|
@ -16,9 +16,8 @@ const { REPO_ROOT, removeDir, readFiles, writeFiles } = require('./utils');
|
|||
|
||||
/** @type {string} */
|
||||
const MONACO_EDITOR_VERSION = (() => {
|
||||
const packageJsonPath = path.join(REPO_ROOT, 'package.json');
|
||||
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath).toString());
|
||||
const version = packageJson.version;
|
||||
const output = cp.execSync(`npm show monaco-editor version`).toString();
|
||||
const version = output.split(/\r\n|\r|\n/g)[0];
|
||||
if (!/\d+\.\d+\.\d+/.test(version)) {
|
||||
console.log('unrecognized package.json version: ' + version);
|
||||
process.exit(1);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue