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

Trims commitId
This commit is contained in:
Henning Dieterichs 2023-02-09 18:48:58 +01:00 committed by GitHub
commit 30f0acb38b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 11 deletions

View file

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

View file

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

View file

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

View file

@ -48,7 +48,7 @@ export async function gitShallowClone(
await run(`git remote add origin ${repositoryUrl}`, options); await run(`git remote add origin ${repositoryUrl}`, options);
await run(`git fetch --depth 1 origin ${ref}`, options); await run(`git fetch --depth 1 origin ${ref}`, options);
await run(`git checkout ${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 }; return { commitId };
} }
@ -77,3 +77,10 @@ export function getNightlyVersion(version: string): string {
const dd = String(date.getUTCDate()).padStart(2, '0'); const dd = String(date.getUTCDate()).padStart(2, '0');
return `0.${minor + 1}.0-dev.${yyyy}${mm}${dd}`; return `0.${minor + 1}.0-dev.${yyyy}${mm}${dd}`;
} }
export interface PackageJson {
version: string;
vscodeRef?: string;
vscodeCommitId?: string;
devDependencies: Record<string, string>;
}