mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-12-12 11:50:54 -06:00
Attach commit as package.json#gitHead in prerelease versions (#47932)
This commit is contained in:
parent
6dbec02a88
commit
9f8a160d53
@ -1,4 +1,5 @@
|
||||
import assert from "assert";
|
||||
import { execFileSync } from "child_process";
|
||||
import { readFileSync, writeFileSync } from "fs";
|
||||
import { normalize, relative } from "path";
|
||||
import url from "url";
|
||||
@ -51,6 +52,7 @@ function main() {
|
||||
// Finally write the changes to disk.
|
||||
// Modify the package.json structure
|
||||
packageJsonValue.version = `${majorMinor}.${prereleasePatch}`;
|
||||
packageJsonValue.gitHead = execFileSync("git", ["rev-parse", "HEAD"], { encoding: "utf8" }).trim();
|
||||
writeFileSync(packageJsonFilePath, JSON.stringify(packageJsonValue, /*replacer:*/ undefined, /*space:*/ 4));
|
||||
writeFileSync(tsFilePath, modifiedTsFileContents);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user