Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/test/automation/tools/copy-package-version.js
3520 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
//@ts-check
7
'use strict';
8
9
const fs = require('fs');
10
const path = require('path');
11
12
const packageDir = path.dirname(__dirname);
13
const root = path.dirname(path.dirname(path.dirname(__dirname)));
14
15
const rootPackageJsonFile = path.join(root, 'package.json');
16
const thisPackageJsonFile = path.join(packageDir, 'package.json');
17
const rootPackageJson = JSON.parse(fs.readFileSync(rootPackageJsonFile, 'utf8'));
18
const thisPackageJson = JSON.parse(fs.readFileSync(thisPackageJsonFile, 'utf8'));
19
20
thisPackageJson.version = rootPackageJson.version;
21
22
fs.writeFileSync(thisPackageJsonFile, JSON.stringify(thisPackageJson, null, ' '));
23
24