Skip to content

Commit

Permalink
Support a specific nightly release (#4)
Browse files Browse the repository at this point in the history
* Support a specific nightly release

* chore: styling

* chore: rebuild dist

Co-authored-by: Oliver Nordbjerg <[email protected]>
  • Loading branch information
CodeSandwich and onbjerg authored Feb 22, 2022
1 parent 594fa29 commit 7a65886
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
7 changes: 5 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -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}`

Expand Down
7 changes: 5 additions & 2 deletions src/utils.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const os = require('os')
const path = require('path')

function mapArch (arch) {
const mappings = {
Expand All @@ -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}`

Expand Down

0 comments on commit 7a65886

Please sign in to comment.