-
Notifications
You must be signed in to change notification settings - Fork 0
Update Windows pre-release version handling. #9
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,6 +4,8 @@ var semver = require('semver'); | |
|
|
||
| var platforms = require('./platforms'); | ||
|
|
||
| var channelRe = /^[a-z]*/ | ||
|
|
||
| // Creates filter function that checks for updates | ||
| function newVersionFilter(opts) { | ||
| return function(version) { | ||
|
|
@@ -41,6 +43,8 @@ function supportsPlatform(requestedPlatform, versionPlatforms) { | |
| platforms.satisfies(requestedPlatform, _.pluck(versionPlatforms, 'type'))); | ||
| } | ||
|
|
||
|
|
||
|
|
||
| module.exports = function(github, opts) { | ||
| // Normalize tag name | ||
| function normalizeTag(tag) { | ||
|
|
@@ -53,7 +57,7 @@ module.exports = function(github, opts) { | |
| var suffix = tag.split('-')[1]; | ||
| if (!suffix) return 'stable'; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you may have moved this out of the closure to allow for testing. Is there another way to to it? Would be nice not to have to move it. Maybe we could test the function that calls into
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, testing is the only reason why I moved it out. It would be nicer to test the public function that calls this instead. The only reason I didn't do that is time. It would require mocking responses from Github. (And there's no benefit for this function being in the closure). Though that's probably a good thing to do in the end - and probably before submitting a PR into the main Nuts repo. Hmm... I'll see if I can knock out a quick mock and test things a better way. |
||
|
|
||
| return suffix.split('.')[0]; | ||
| return suffix.match(channelRe)[0] || suffix.split('.')[0]; | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll write tests for this... |
||
| } | ||
|
|
||
| // Normalize a release to a version | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huh, how was this working before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It wasn't. This is a change I made (to support proxying). We weren't doing Windows releases before so this never got called.