From f9c53f16a51034d515af4fcc2226433dc1e7c638 Mon Sep 17 00:00:00 2001 From: Henning Dieterichs Date: Thu, 9 Feb 2023 18:42:15 +0100 Subject: [PATCH] Trims commitId --- scripts/ci/monaco-editor-core-prepare.ts | 3 +-- scripts/ci/monaco-editor-prepare.ts | 3 +-- scripts/ci/types.ts | 6 ------ scripts/lib/index.ts | 9 ++++++++- 4 files changed, 10 insertions(+), 11 deletions(-) delete mode 100644 scripts/ci/types.ts diff --git a/scripts/ci/monaco-editor-core-prepare.ts b/scripts/ci/monaco-editor-core-prepare.ts index 4c5a555e..ea70c44b 100644 --- a/scripts/ci/monaco-editor-core-prepare.ts +++ b/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, '..', '..'); diff --git a/scripts/ci/monaco-editor-prepare.ts b/scripts/ci/monaco-editor-prepare.ts index 96a17f6d..c8f75484 100644 --- a/scripts/ci/monaco-editor-prepare.ts +++ b/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, '..', '..'); diff --git a/scripts/ci/types.ts b/scripts/ci/types.ts deleted file mode 100644 index 4d364a3b..00000000 --- a/scripts/ci/types.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface PackageJson { - version: string; - vscodeRef?: string; - vscodeCommitId?: string; - devDependencies: Record; -} diff --git a/scripts/lib/index.ts b/scripts/lib/index.ts index b2903a92..507e15c3 100644 --- a/scripts/lib/index.ts +++ b/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; +}