Skip to content

Commit 543493c

Browse files
RaisinTenrichardlau
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#2 which updates deps/icu-small/source/data/in/icudt71l.dat.bz2. Fixes: #44865 Signed-off-by: Darshan Sen <raisinten@gmail.com> PR-URL: #44870 Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
1 parent 197df63 commit 543493c

1 file changed

Lines changed: 2 additions & 8 deletions

File tree

‎tools/update-timezone.mjs‎

Lines changed: 2 additions & 8 deletions
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)