Path: blob/main/test/automation/tools/copy-package-version.js
3520 views
/*---------------------------------------------------------------------------------------------1* Copyright (c) Microsoft Corporation. All rights reserved.2* Licensed under the MIT License. See License.txt in the project root for license information.3*--------------------------------------------------------------------------------------------*/45//@ts-check6'use strict';78const fs = require('fs');9const path = require('path');1011const packageDir = path.dirname(__dirname);12const root = path.dirname(path.dirname(path.dirname(__dirname)));1314const rootPackageJsonFile = path.join(root, 'package.json');15const thisPackageJsonFile = path.join(packageDir, 'package.json');16const rootPackageJson = JSON.parse(fs.readFileSync(rootPackageJsonFile, 'utf8'));17const thisPackageJson = JSON.parse(fs.readFileSync(thisPackageJsonFile, 'utf8'));1819thisPackageJson.version = rootPackageJson.version;2021fs.writeFileSync(thisPackageJsonFile, JSON.stringify(thisPackageJson, null, ' '));222324