Skip to content

Commit 3119382

Browse files
authored
Update set-dev-version.js
1 parent 14bcd15 commit 3119382

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

scripts/set-dev-version.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@
66

77
const fs = require('fs');
88

9+
// Leading `0` aren't valid semver, so we round it up to 10 to
10+
// avoid having to change the nightly version format.
11+
function roundToTen(value) {
12+
return value < 10 ? 10 : value;
13+
}
14+
915
function leftPad(value) {
1016
return (value < 10 ? '0' : '') + value;
1117
}
@@ -18,7 +24,7 @@ const formattedDate =
1824
leftPad(date.getUTCMonth() + 1) +
1925
leftPad(date.getUTCDate()) +
2026
'.' +
21-
leftPad(date.getUTCHours()) +
27+
leftPad(roundToTen(date.getUTCHours())) +
2228
leftPad(date.getUTCMinutes());
2329

2430
// Remove any existing suffix before appending the date
@@ -30,4 +36,5 @@ fs.writeFileSync(
3036
packageManifestFilename,
3137
JSON.stringify(packageManifest, null, 2) + '\n'
3238
);
39+
3340
console.log('Updated version number to ' + version);

0 commit comments

Comments
 (0)