File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 6
6
7
7
const fs = require ( 'fs' ) ;
8
8
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
+
9
15
function leftPad ( value ) {
10
16
return ( value < 10 ? '0' : '' ) + value ;
11
17
}
@@ -18,7 +24,7 @@ const formattedDate =
18
24
leftPad ( date . getUTCMonth ( ) + 1 ) +
19
25
leftPad ( date . getUTCDate ( ) ) +
20
26
'.' +
21
- leftPad ( date . getUTCHours ( ) ) +
27
+ leftPad ( roundToTen ( date . getUTCHours ( ) ) ) +
22
28
leftPad ( date . getUTCMinutes ( ) ) ;
23
29
24
30
// Remove any existing suffix before appending the date
@@ -30,4 +36,5 @@ fs.writeFileSync(
30
36
packageManifestFilename ,
31
37
JSON . stringify ( packageManifest , null , 2 ) + '\n'
32
38
) ;
39
+
33
40
console . log ( 'Updated version number to ' + version ) ;
You can’t perform that action at this time.
0 commit comments