Include monaco-editor git commit id in release

This commit is contained in:
Henning Dieterichs 2023-02-09 18:55:14 +01:00
parent 30f0acb38b
commit c59c649c28
No known key found for this signature in database
GPG key ID: 771381EFFDB9EC06
2 changed files with 9 additions and 2 deletions

View file

@ -37,6 +37,11 @@ export async function runGetOutput(command: string, options: RunOptions): Promis
});
}
export async function gitCommitId(repositoryPath: string): Promise<string> {
const commitId = (await runGetOutput('git rev-parse HEAD', { cwd: repositoryPath })).trim();
return commitId;
}
export async function gitShallowClone(
targetPath: string,
repositoryUrl: string,
@ -48,7 +53,7 @@ export async function gitShallowClone(
await run(`git remote add origin ${repositoryUrl}`, options);
await run(`git fetch --depth 1 origin ${ref}`, options);
await run(`git checkout ${ref}`, options);
const commitId = (await runGetOutput('git rev-parse HEAD', options)).trim();
const commitId = await gitCommitId(targetPath);
return { commitId };
}
@ -82,5 +87,6 @@ export interface PackageJson {
version: string;
vscodeRef?: string;
vscodeCommitId?: string;
monacoCommitId?: string;
devDependencies: Record<string, string>;
}