| 64 | }; |
| 65 | |
| 66 | const getNSSVersion = async (release) => { |
| 67 | const latestFirefox = release.version; |
| 68 | const firefoxTag = `FIREFOX_${latestFirefox.replaceAll('.', '_')}_RELEASE`; |
| 69 | const tagInfoURL = `https://hg.mozilla.org/releases/mozilla-release/raw-file/${firefoxTag}/security/nss/TAG-INFO`; |
| 70 | if (values.verbose) { |
| 71 | console.log(`Fetching NSS tag from ${tagInfoURL}.`); |
| 72 | } |
| 73 | const tagInfo = await fetch(tagInfoURL); |
| 74 | if (!tagInfo.ok) { |
| 75 | console.error(`Failed to fetch ${tagInfoURL}: ${tagInfo.status}: ${tagInfo.statusText}`); |
| 76 | } |
| 77 | const tag = await tagInfo.text(); |
| 78 | if (values.verbose) { |
| 79 | console.log(`Found tag ${tag}.`); |
| 80 | } |
| 81 | // Tag will be of form `NSS_x_y_RTM`. Convert to `x.y`. |
| 82 | return tag.split('_').slice(1, -1).join('.'); |
| 83 | }; |
| 84 | |
| 85 | const options = { |
| 86 | help: { |