Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/build/lib/getVersion.ts
3520 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
import * as git from './git';
7
8
export function getVersion(root: string): string | undefined {
9
let version = process.env['BUILD_SOURCEVERSION'];
10
11
if (!version || !/^[0-9a-f]{40}$/i.test(version.trim())) {
12
version = git.getVersion(root);
13
}
14
15
return version;
16
}
17
18