Skip to content

Commit e6dd59c

Browse files
committed
fix: use dots in release tag and filename for ICU >= 78
Starting from ICU 78.1, the unicode-org/icu GitHub releases reverted to using dots in both the release tag (release-78.1) and the filename (icu4c-78.1-data-bin-l.zip), instead of hyphens/underscores used in versions 69-77. URL format by version range: - v67-v68: release-67-1/icu4c-67.1-data-bin-l.zip (hyphens in tag, dots in file) - v69-v77: release-73-1/icu4c-73_1-data-bin-l.zip (hyphens in tag, underscores in file) - v78+: release-78.1/icu4c-78.1-data-bin-l.zip (dots in both)
1 parent 37c4848 commit e6dd59c

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

install-gh-data.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,13 @@ module.exports = async function installFromGithub (fullIcu, advice) {
2121
const _baseUrl = process.env.FULL_ICU_BASEURL || 'https://github.com/unicode-org/icu/releases/'
2222
const baseUrl = new URL(_baseUrl)
2323
const versionsAsHyphen = fullIcu.icuver.replace(/\./g, '-')
24-
// ICU v67/v68 use "68.1" and "67.1" in the filename instead of 68_1 and 69_1
24+
// ICU v67/v68 use "68.1" and "67.1" in the filename instead of 68_1 and 67_1
25+
// ICU v69-v77 use underscores in the filename and hyphens in the tag
26+
// ICU >= v78 reverted to dots in both the release tag and filename
2527
// https://unicode-org.atlassian.net/browse/ICU-21764
26-
// Can remove this conditional if the files are updated later.
27-
const versionsAsUnderscore = (fullIcu.icumaj >= 69) ? fullIcu.icuver.replace(/\./g, '_') : fullIcu.icuver
28-
const tag = `release-${versionsAsHyphen}`
29-
const file = `icu4c-${versionsAsUnderscore}-data-bin-${icuend}.zip`
28+
const versionInFilename = (fullIcu.icumaj >= 78) ? fullIcu.icuver : (fullIcu.icumaj >= 69) ? fullIcu.icuver.replace(/\./g, '_') : fullIcu.icuver
29+
const tag = (fullIcu.icumaj >= 78) ? `release-${fullIcu.icuver}` : `release-${versionsAsHyphen}`
30+
const file = `icu4c-${versionInFilename}-data-bin-${icuend}.zip`
3031
const fullUrl = new URL(`./download/${tag}/${file}`, baseUrl)
3132
console.log(fullUrl.toString())
3233
const [srcZip, tmpd] = await myFetch(fullUrl)

0 commit comments

Comments
 (0)