Skip to content

Commit eaa919e

Browse files
committed
tools: apply 2022a timezone patch on icu file
Fixes: nodejs#43134
1 parent 564e813 commit eaa919e

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

tools/update-timezone.mjs

+29-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,33 @@
11
#!/usr/bin/env node
22
// Usage: tools/update-timezone.mjs [--dry]
33
// Passing --dry will redirect output to stdout.
4+
import { execSync, spawnSync } from 'node:child_process';
5+
import { renameSync } from 'node:fs';
6+
const fileNames = [
7+
'zoneinfo64.res',
8+
'windowsZones.res',
9+
'timezoneTypes.res',
10+
'metaZones.res',
11+
];
12+
13+
execSync('rm -rf icu-data');
14+
execSync('git clone https://github.com/unicode-org/icu-data');
15+
execSync('bzip2 -d deps/icu-small/source/data/in/icudt70l.dat.bz2');
16+
fileNames.forEach((file)=>{
17+
renameSync(`icu-data/tzdata/icunew/2022a/44/le/${file}`,`deps/icu-small/source/data/in/${file}`)
18+
})
19+
fileNames.forEach((file) => {
20+
spawnSync(
21+
`icupkg`,[
22+
`-a`,
23+
file,
24+
`icudt70l.dat`
25+
],{cwd:`deps/icu-small/source/data/in/`}
26+
);
27+
});
28+
execSync('bzip2 -z deps/icu-small/source/data/in/icudt70l.dat')
29+
fileNames.forEach((file)=>{
30+
renameSync(`deps/icu-small/source/data/in/${file}`,`icu-data/tzdata/icunew/2022a/44/le/${file}`)
31+
})
32+
execSync('rm -rf icu-data');
433

5-
console.log('Initial Skeleton');

0 commit comments

Comments
 (0)