Skip to content

Commit

Permalink
#2243 sort by process name instead id
Browse files Browse the repository at this point in the history
  • Loading branch information
Unitech committed Jun 29, 2016
1 parent 0f51a30 commit b9ce855
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ pm2.interact(opts, cb)

#### Changes notes

- pm2 list processes are now sorted by name instead id
- Display NPM loader when installing module
- All tests have been adapted for the new API. No major test changes, just fix (like null -> null() with should)
- Multiple, separated instances of PM2 can now be managed, allowing a better integration with softwares
Expand Down
8 changes: 8 additions & 0 deletions lib/CLI/CliUx.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,14 @@ UX.dispAsTable = function(list, interact_infos) {
if (!list)
return console.log('list empty');

list.sort(function(a, b) {
if (a.pm2_env.name < b.pm2_env.name)
return -1;
if (a.pm2_env.name > b.pm2_env.name)
return 1;
return 0;
});

list.forEach(function(l) {
var obj = {};

Expand Down

0 comments on commit b9ce855

Please sign in to comment.