瀏覽代碼

Merge pull request #3540 from microsoft/hediet/agreed-turtle

Trims commitId
Henning Dieterichs 2 年之前
父節點
當前提交
30f0acb38b
共有 4 個文件被更改,包括 10 次插入11 次删除
  1. 1 2
      scripts/ci/monaco-editor-core-prepare.ts
  2. 1 2
      scripts/ci/monaco-editor-prepare.ts
  3. 0 6
      scripts/ci/types.ts
  4. 8 1
      scripts/lib/index.ts

+ 1 - 2
scripts/ci/monaco-editor-core-prepare.ts

@@ -1,7 +1,6 @@
 import { mkdir, rm } from 'fs/promises';
 import { join, resolve } from 'path';
-import { group, gitShallowClone, run, writeJsonFile, getNightlyVersion } from '../lib';
-import { PackageJson } from './types';
+import { PackageJson, group, gitShallowClone, run, writeJsonFile, getNightlyVersion } from '../lib';
 
 const selfPath = __dirname;
 const rootPath = join(selfPath, '..', '..');

+ 1 - 2
scripts/ci/monaco-editor-prepare.ts

@@ -1,7 +1,6 @@
 import { readFile } from 'fs/promises';
 import { join, resolve } from 'path';
-import { getNightlyVersion, group, run, writeJsonFile } from '../lib';
-import { PackageJson } from './types';
+import { PackageJson, getNightlyVersion, group, run, writeJsonFile } from '../lib';
 
 const selfPath = __dirname;
 const rootPath = join(selfPath, '..', '..');

+ 0 - 6
scripts/ci/types.ts

@@ -1,6 +0,0 @@
-export interface PackageJson {
-	version: string;
-	vscodeRef?: string;
-	vscodeCommitId?: string;
-	devDependencies: Record<string, string>;
-}

+ 8 - 1
scripts/lib/index.ts

@@ -48,7 +48,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);
+	const commitId = (await runGetOutput('git rev-parse HEAD', options)).trim();
 	return { commitId };
 }
 
@@ -77,3 +77,10 @@ export function getNightlyVersion(version: string): string {
 	const dd = String(date.getUTCDate()).padStart(2, '0');
 	return `0.${minor + 1}.0-dev.${yyyy}${mm}${dd}`;
 }
+
+export interface PackageJson {
+	version: string;
+	vscodeRef?: string;
+	vscodeCommitId?: string;
+	devDependencies: Record<string, string>;
+}