Skip to content
Permalink
Browse files

fix(installer): dont fetch prerelease versions unless instructed

  • Loading branch information
MarshallOfSound committed Dec 31, 2016
1 parent 9358eb4 commit 1b88b153f9ffd55cd059753274dc1879689effc0
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/electron-forge-install.js
@@ -29,6 +29,7 @@ const main = async () => {
program
.version(require('../package.json').version)
.arguments('[repository]')
.option('--prerelease', 'Fetch prerelease versions')
.action((repository) => {
repo = repository;
})
@@ -56,6 +57,8 @@ const main = async () => {
throw `Failed to find releases for repository "${repo}". Please check the name and try again.`;
}

releases = releases.filter(release => !release.prerelease || program.prerelease);

const sortedReleases = releases.sort((releaseA, releaseB) => {
let tagA = releaseA.tag_name;
if (tagA.substr(0, 1) === 'v') tagA = tagA.substr(1);
@@ -93,7 +96,7 @@ const main = async () => {
}
});

console.info('Found latest release:', `${latestRelease.tag_name}`.cyan);
console.info(`Found latest release${program.prerelease ? ' (including prereleases)' : ''}: ${latestRelease.tag_name.cyan}`);

let targetAsset = possibleAssets[0];
if (possibleAssets.length > 1) {

0 comments on commit 1b88b15

Please sign in to comment.
You can’t perform that action at this time.