diff options
author | Darshan Sen <raisinten@gmail.com> | 2022-10-03 08:16:48 +0300 |
---|---|---|
committer | Node.js GitHub Bot <github-bot@iojs.org> | 2022-10-10 18:23:50 +0300 |
commit | 71e9bc110835920e7c9c76b5bbbcc0687b5448dc (patch) | |
tree | 52e47aebdfb1bf1568391d42822d66751b463798 /tools | |
parent | 22c39b1ddd2f5f2ed13397b351b05836f7abea54 (diff) |
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 -
https://github.com/RaisinTen/node/pull/2 which updates
deps/icu-small/source/data/in/icudt71l.dat.bz2.
Fixes: https://github.com/nodejs/node/issues/44865
Signed-off-by: Darshan Sen <raisinten@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/44870
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/update-timezone.mjs | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/tools/update-timezone.mjs b/tools/update-timezone.mjs index 33da42f4e98..bf3498b8abf 100755 --- a/tools/update-timezone.mjs +++ b/tools/update-timezone.mjs @@ -1,6 +1,6 @@ #!/usr/bin/env node // Usage: tools/update-timezone.mjs -import { execSync, spawnSync } from 'node:child_process'; +import { execSync } from 'node:child_process'; import { renameSync, readdirSync, rmSync } from 'node:fs'; import { exit } from 'node:process'; @@ -26,13 +26,7 @@ if (latestVersion === currentVersion) { execSync('bzip2 -d deps/icu-small/source/data/in/icudt*.dat.bz2'); fileNames.forEach((file) => { renameSync(`icu-data/tzdata/icunew/${latestVersion}/44/le/${file}`, `deps/icu-small/source/data/in/${file}`); - spawnSync( - 'icupkg', [ - '-a', - file, - 'icudt*.dat', - ], { cwd: 'deps/icu-small/source/data/in/' } - ); + execSync(`icupkg -a ${file} icudt*.dat`, { cwd: 'deps/icu-small/source/data/in/' }); rmSync(`deps/icu-small/source/data/in/${file}`); }); execSync('bzip2 -z deps/icu-small/source/data/in/icudt*.dat'); |