Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid installing pre-release by default #25

Merged
merged 5 commits into from
Feb 17, 2023

Conversation

FriggaHel
Copy link
Contributor

@FriggaHel FriggaHel commented Feb 17, 2023

Changes:

  • Avoid installing pre-release except if mentioned
  • Always skip drafts
  • Skip versions with no assets

@FriggaHel FriggaHel marked this pull request as ready for review February 17, 2023 15:53
@FriggaHel FriggaHel requested a review from a team as a code owner February 17, 2023 15:53
@FriggaHel FriggaHel requested review from a team and removed request for a team February 17, 2023 15:56
@@ -16376,8 +16384,13 @@ async function selectCompatibleVersion(versionSpec) {

const versions = response.data;
for (let i = 0; i < versions.length; i++) {
if (versionSpec === undefined || versionSpec === "latest"
|| semver.satisfies(versions[i].tag_name, versionSpec)) {
if (versions[i].draft || versions[i].assets?.length === 0) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: I used a three if approach as it gives a much better readability compared to one unique if with multiple cases.

src/install.js Outdated Show resolved Hide resolved
@FriggaHel FriggaHel merged commit f401339 into main Feb 17, 2023
@FriggaHel FriggaHel deleted the DEVX-2141-prevent-non-stable-versions branch February 17, 2023 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants