Skip to content

Commit af2d9cc

Browse files
RaisinTenguangwong
authored andcommitted
tools: fix timezone update tool
The spawnSync call was previously silently failing with this error: ```sh icupkg: unable to open input file "icudt*.dat" ``` because spawnSync doesn't support globbing. This change replaces the spawnSync call with execSync because that supports globbing. I have tested this workflow with some minor modifications in my fork and I can confirm that it works as expected now. The bot opened this PR - RaisinTen/node#2 which updates deps/icu-small/source/data/in/icudt71l.dat.bz2. Fixes: nodejs/node#44865 Signed-off-by: Darshan Sen <[email protected]> PR-URL: nodejs/node#44870 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]>
1 parent b697486 commit af2d9cc

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

tools/update-timezone.mjs

+2-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env node
22
// Usage: tools/update-timezone.mjs
3-
import { execSync, spawnSync } from 'node:child_process';
3+
import { execSync } from 'node:child_process';
44
import { renameSync, readdirSync, rmSync } from 'node:fs';
55
import { exit } from 'node:process';
66

@@ -26,13 +26,7 @@ if (latestVersion === currentVersion) {
2626
execSync('bzip2 -d deps/icu-small/source/data/in/icudt*.dat.bz2');
2727
fileNames.forEach((file) => {
2828
renameSync(`icu-data/tzdata/icunew/${latestVersion}/44/le/${file}`, `deps/icu-small/source/data/in/${file}`);
29-
spawnSync(
30-
'icupkg', [
31-
'-a',
32-
file,
33-
'icudt*.dat',
34-
], { cwd: 'deps/icu-small/source/data/in/' }
35-
);
29+
execSync(`icupkg -a ${file} icudt*.dat`, { cwd: 'deps/icu-small/source/data/in/' });
3630
rmSync(`deps/icu-small/source/data/in/${file}`);
3731
});
3832
execSync('bzip2 -z deps/icu-small/source/data/in/icudt*.dat');

0 commit comments

Comments
 (0)