Skip to content

Commit ba275d2

Browse files
committed
ci: Allow downloading tzcode archive as well as tzdata
1 parent 6bf33a2 commit ba275d2

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

tasks/data-download.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@ module.exports = function (grunt) {
88
version = version || 'latest';
99

1010
var done = this.async(),
11+
fetchCode = grunt.option('fetch-tzcode'),
12+
type = fetchCode ? 'code' : 'data',
1113
src = (version === 'latest' ?
12-
'https://data.iana.org/time-zones/tzdata-latest.tar.gz' :
13-
'https://data.iana.org/time-zones/releases/tzdata' + version + '.tar.gz'),
14-
curl = path.resolve('temp/curl', version, 'data.tar.gz'),
14+
'https://data.iana.org/time-zones/tz' + type + '-latest.tar.gz' :
15+
'https://data.iana.org/time-zones/releases/tz' + type + version + '.tar.gz'),
16+
curl = path.resolve('temp/curl', version, type + '.tar.gz'),
1517
dest = path.resolve('temp/download', version);
1618

1719
grunt.file.mkdir(path.dirname(curl));

0 commit comments

Comments
 (0)