mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-17 09:35:37 -05:00
19 lines
1.0 KiB
JavaScript
19 lines
1.0 KiB
JavaScript
/*---------------------------------------------------------------------------------------------
|
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
|
*--------------------------------------------------------------------------------------------*/
|
|
|
|
const cp = require('child_process');
|
|
const path = require('path');
|
|
const fs = require('fs');
|
|
|
|
const rootPath = path.dirname(path.dirname(path.dirname(__dirname)));
|
|
const vscodePath = path.join(rootPath, 'azuredatastudio'); // {{SQL CARBON EDIT}} replace vscode
|
|
const distroPath = path.join(rootPath, 'azuredatastudio-release'); // {{SQL CARBON EDIT}} replace vscode
|
|
const commit = cp.execSync('git rev-parse HEAD', { cwd: distroPath, encoding: 'utf8' }).trim();
|
|
const packageJsonPath = path.join(vscodePath, 'package.json');
|
|
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
|
|
|
|
packageJson.distro = commit;
|
|
fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2));
|