Files
vscode/build/npm/update-distro.ts
Matt Bierner e779f86b17 Build script cleanup
For #277526

Quick cleanup pass after converting these scripts
2025-11-24 14:07:28 -08:00

18 lines
967 B
TypeScript

/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { execSync } from 'child_process';
import { join, resolve } from 'path';
import { readFileSync, writeFileSync } from 'fs';
const rootPath = resolve(import.meta.dirname, '..', '..', '..');
const vscodePath = join(rootPath, 'vscode');
const distroPath = join(rootPath, 'vscode-distro');
const commit = execSync('git rev-parse HEAD', { cwd: distroPath, encoding: 'utf8' }).trim();
const packageJsonPath = join(vscodePath, 'package.json');
const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf8'));
packageJson.distro = commit;
writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2));