Skip to content

Commit

Permalink
fix(installer): dont fetch prerelease versions unless instructed
Browse files Browse the repository at this point in the history
  • Loading branch information
MarshallOfSound committed Dec 31, 2016
1 parent 9358eb4 commit 1b88b15
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/electron-forge-install.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const main = async () => {
program
.version(require('../package.json').version)
.arguments('[repository]')
.option('--prerelease', 'Fetch prerelease versions')
.action((repository) => {
repo = repository;
})
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 1b88b15

Please sign in to comment.