Skip to content

Commit

Permalink
tools: apply 2022a timezone patch on icu file
Browse files Browse the repository at this point in the history
  • Loading branch information
98lenvi committed Jul 26, 2022
1 parent 8c5b81c commit 0a4fd3e
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion tools/update-timezone.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,33 @@
#!/usr/bin/env node
// Usage: tools/update-timezone.mjs [--dry]
// Passing --dry will redirect output to stdout.
import { execSync, spawnSync } from 'node:child_process';
import { renameSync } from 'node:fs';
const fileNames = [
'zoneinfo64.res',
'windowsZones.res',
'timezoneTypes.res',
'metaZones.res',
];

execSync('rm -rf icu-data');
execSync('git clone https://github.com/unicode-org/icu-data');
execSync('bzip2 -d deps/icu-small/source/data/in/icudt70l.dat.bz2');
fileNames.forEach((file)=>{
renameSync(`icu-data/tzdata/icunew/2022a/44/le/${file}`,`deps/icu-small/source/data/in/${file}`)
})
fileNames.forEach((file) => {
spawnSync(
`icupkg`,[
`-a`,
file,
`icudt70l.dat`
],{cwd:`deps/icu-small/source/data/in/`}
);
});
execSync('bzip2 -z deps/icu-small/source/data/in/icudt70l.dat')
fileNames.forEach((file)=>{
renameSync(`deps/icu-small/source/data/in/${file}`,`icu-data/tzdata/icunew/2022a/44/le/${file}`)
})
execSync('rm -rf icu-data');

console.log('Initial Skeleton');

0 comments on commit 0a4fd3e

Please sign in to comment.