mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-23 01:58:29 +00:00
Pad build numbers so that alpha-sort produces correct ordering
This commit is contained in:
@@ -89,9 +89,20 @@ function copyRecursive(sourceRoot: string, destRoot: string, matchGlob: string)
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function getBuildNumber() {
|
function leftPad(str: string, minLength: number, padChar: string) {
|
||||||
return process.env.APPVEYOR_BUILD_NUMBER
|
while (str.length < minLength) {
|
||||||
|| ('t-' + Math.floor((new Date().valueOf() - new Date(2017, 0, 1).valueOf()) / (60*1000)));
|
str = padChar + str;
|
||||||
|
}
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getBuildNumber(): string {
|
||||||
|
if (process.env.APPVEYOR_BUILD_NUMBER) {
|
||||||
|
return leftPad(process.env.APPVEYOR_BUILD_NUMBER, 6, '0');
|
||||||
|
}
|
||||||
|
|
||||||
|
// For local builds, use timestamp
|
||||||
|
return 't-' + Math.floor((new Date().valueOf() - new Date(2017, 0, 1).valueOf()) / (60*1000));
|
||||||
}
|
}
|
||||||
|
|
||||||
function buildYeomanNpmPackage(outputRoot: string) {
|
function buildYeomanNpmPackage(outputRoot: string) {
|
||||||
|
|||||||
Reference in New Issue
Block a user