-
Notifications
You must be signed in to change notification settings - Fork 420
Sort using semver #8
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
Conversation
|
Haha! Yes, we could use |
update
Outdated
| version += '-' + build.prerelease; | ||
| } | ||
| if (build.build && build.build.length > 0) { | ||
| version += '-' + build.build; |
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.
Should be '+' here.
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.
Fixed.
| fs.readdir(path.join(__dirname, '/bin'), function (err, files) { | ||
| if (err) return err | ||
|
|
||
| function buildVersion (build) { |
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.
Do we really need to rebuild it again?
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.
Actually if we rebuild it with MM.DD we don't even need semver to do the comparison.
| .map(function (pars) { console.log(pars[0]); return { path: pars[0], version: pars[1], prerelease: pars[3], build: pars[5] } }) | ||
| .sort(function (a, b) { | ||
| // NOTE: a vs. b (the order is important), because we want oldest first in the list | ||
| return semver.compare(buildVersion(a), buildVersion(b)) |
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.
We could just use the semver module to also parse the version string.
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.
True, the only downside having semver is that it must be npm installed before running update.
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.
Actually semver doesn't seem to return the build part (only versions and prerelease).
|
This works well with #11 (parsedList becomes the sortedList). |
|
@chriseth are we happy adding The Solidity push script I prefer a) for the moment, until we add more dependencies. |
|
Actually I think it is more future proof (less changes in the Solidity repo) if we have a package.json (marked @chriseth added that in that case we could also run |
ee1cb87 to
341f8f3
Compare
Fixes the out of order versions.
However for simplicity we should just move to dates in the form of YYYY.MM.DD (and not YYYY.M.D).