diff --git a/dist/index.js b/dist/index.js index 1ddf763..532d52a 100644 --- a/dist/index.js +++ b/dist/index.js @@ -5447,7 +5447,6 @@ if (require.main === require.cache[eval('__filename')]) { /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const os = __nccwpck_require__(37) -const path = __nccwpck_require__(17) function mapArch (arch) { const mappings = { @@ -5458,9 +5457,13 @@ function mapArch (arch) { return mappings[arch] || arch } +function normalizeVersionName (version) { + return version.replace(/^nightly-[0-9a-f]{40}$/, 'nightly') +} + function getDownloadObject (version) { const platform = os.platform() - const filename = `foundry_${version}_${platform}_${mapArch(os.arch())}` + const filename = `foundry_${normalizeVersionName(version)}_${platform}_${mapArch(os.arch())}` const extension = platform === 'win32' ? 'zip' : 'tar.gz' const url = `https://github.com/gakonst/foundry/releases/download/${version}/${filename}.${extension}` diff --git a/src/utils.js b/src/utils.js index 5257973..d8efa67 100644 --- a/src/utils.js +++ b/src/utils.js @@ -1,5 +1,4 @@ const os = require('os') -const path = require('path') function mapArch (arch) { const mappings = { @@ -10,9 +9,13 @@ function mapArch (arch) { return mappings[arch] || arch } +function normalizeVersionName (version) { + return version.replace(/^nightly-[0-9a-f]{40}$/, 'nightly') +} + function getDownloadObject (version) { const platform = os.platform() - const filename = `foundry_${version}_${platform}_${mapArch(os.arch())}` + const filename = `foundry_${normalizeVersionName(version)}_${platform}_${mapArch(os.arch())}` const extension = platform === 'win32' ? 'zip' : 'tar.gz' const url = `https://github.com/gakonst/foundry/releases/download/${version}/${filename}.${extension}`