GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Allow canary releases by dsame · Pull Request #605 · actions/setup-node Conversation
|
| return version; | ||
| } | ||
|
|
||
| // TODO - should we just export this from @actions/tool-cache? Lifted directly from there |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This comment isn't relevant anymore since we're changing the logic
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| versions = versions.sort((a, b) => { | ||
| if (semver.gt(a, b)) { | ||
| return 1; | ||
| } | ||
| return -1; | ||
| }); |
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
There's a compare function you can pass to Array.prototype.sort: https://github.com/npm/node-semver#comparison
| versions = versions.sort((a, b) => { | |
| if (semver.gt(a, b)) { | |
| return 1; | |
| } | |
| return -1; | |
| }); | |
| versions = versions.sort(semver.compare); |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| const versionsReversed = versions.sort((a, b) => { | ||
| if (semver.gt(a, b)) { | ||
| return -1; | ||
| } else if (semver.lt(a, b)) { | ||
| return 1; | ||
| } | ||
| return 0; | ||
| }); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
There's also an rcompare function:
| const versionsReversed = versions.sort((a, b) => { | |
| if (semver.gt(a, b)) { | |
| return -1; | |
| } else if (semver.lt(a, b)) { | |
| return 1; | |
| } | |
| return 0; | |
| }); | |
| const versionsReversed = versions.sort(semver.rcompare); |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| versionSpec: string | ||
| ): string { | ||
| let version = ''; | ||
| let range: string | null | undefined; |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
| let range: string | null | undefined; | |
| let range: string | undefined; |
doesn't look like it's ever null?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
A few minor suggestions but looks good
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| versionSpec: string | ||
| ): string { | ||
| let version = ''; | ||
| let range: string | null | undefined; |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
| let range: string | null | undefined; | |
| let range: string | undefined; |
doesn't look like it's ever null?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
206b7e5 to
8285caf
Compare
76c3871 to
21dbe7e
Compare
|
The PR to be abandoned for sake of this PR #619 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I'm going to close the pull request in favour of this: #655 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.