tools: remove faulty early termination logic from update-timezone.mjs

We do not build Node.js in the workflow so
f4815fcd76/tools/update-timezone.mjs (L18)
is actually the version of `tzdata` in the Node.js in the runner instead
of what's in `main`.

The script is pretty fast even when the versions differ and there is an
update, so this optimization doesn't seem to be worth having given the
problem.

Signed-off-by: Darshan Sen <raisinten@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/44870
Fixes: https://github.com/nodejs/node/issues/44865
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
pull/44956/head
Darshan Sen 2022-10-03 15:48:06 +05:30 committed by Node.js GitHub Bot
parent 71e9bc1108
commit b5add9757d
1 changed files with 0 additions and 7 deletions

View File

@ -2,7 +2,6 @@
// Usage: tools/update-timezone.mjs
import { execSync } from 'node:child_process';
import { renameSync, readdirSync, rmSync } from 'node:fs';
import { exit } from 'node:process';
const fileNames = [
'zoneinfo64.res',
@ -15,14 +14,8 @@ const availableVersions = readdirSync('icu-data/tzdata/icunew', { withFileTypes:
.filter((dirent) => dirent.isDirectory())
.map((dirent) => dirent.name);
const currentVersion = process.versions.tz;
const latestVersion = availableVersions.sort().at(-1);
if (latestVersion === currentVersion) {
console.log(`Terminating early, tz version is latest @ ${currentVersion}`);
exit();
}
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}`);