Skip to content

Commit

Permalink
feature: pm2 plus xx yy now generates a name with hostname-UID
Browse files Browse the repository at this point in the history
  • Loading branch information
Unitech committed Jul 12, 2018
1 parent f807937 commit fcf75e2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 4 additions & 0 deletions bin/pm2
Original file line number Diff line number Diff line change
Expand Up @@ -605,12 +605,16 @@ commander.command('plus [secret] [public] [name]')
infoNode: _opts.infoNode,
discrete: _opts.discrete,
installAll: _opts.installAll,
gen_uid: _opts.gen,
public: pub,
secret: sec,
name: name,
ws: true
}

if (!name)
opts.name = require('os').hostname() + '-' + require('crypto').randomBytes(2).toString('hex')

if (sec == null && pub == null) {
return pm2._pre_interact(null, null, null, opts, function(err, dt) {
pm2.speedList()
Expand Down
3 changes: 1 addition & 2 deletions lib/API/Interaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,7 @@ module.exports = function(CLI) {
}
KMDaemon.launchAndInteract(that._conf, infos, function(err, dt) {
if (err) {
Common.printError(chalk.red('[PM2 agent] ') + err)
Common.printError(chalk.cyan('[PM2 agent] ') + 'Run `$ pm2 plus` to connect')
Common.printError(chalk.cyan('[PM2.IO] ') + 'Run `$ pm2 plus` to connect')
return that.exitCli(cst.ERROR_EXIT);
}
if (!cb) {
Expand Down

0 comments on commit fcf75e2

Please sign in to comment.