Skip to content

Commit

Permalink
Fix the order in which updates are presented (#736)
Browse files Browse the repository at this point in the history
Fix the order in which updates are presented

Fix #737
  • Loading branch information
johnnyman727 authored and wyze committed May 12, 2016
1 parent 24fdd7d commit 52ae38d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,7 @@ controller.printAvailableUpdates = function() {
logs.info('Latest builds:');

// Reverse the list to show the latest version first
builds.reverse().slice(-10).forEach(function(build) {
builds.reverse().slice(0, 10).forEach(function(build) {
logs.basic('\t Version:', build.version, '\tPublished:', new Date(build.released).toLocaleString());
});
});
Expand Down
6 changes: 2 additions & 4 deletions lib/update-fetch.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,8 @@ function requestBuildList() {
reject(err);
}

// Sort the builds by semver version
builds.sort((a, b) => {
return semver.gt(a.version, b.version);
});
// Sort the builds by semver version in chronological order
builds.sort((a, b) => semver.compare(a.version, b.version));

return resolve(builds);
} else {
Expand Down

0 comments on commit 52ae38d

Please sign in to comment.