Skip to content

Commit 0c039cb

Browse files
committed
#3345 do not spawn daemon if pm2 -v
1 parent 9dcb2c6 commit 0c039cb

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

bin/pm2

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,12 @@ if (process.argv.indexOf('-s') > -1) {
112112
}
113113
}
114114

115+
// Override -v behavior (do not spawn daemon)
116+
if (process.argv.indexOf('-v') > -1) {
117+
console.log(pkg.version);
118+
return process.exit(0);
119+
}
120+
115121
function beginCommandProcessing() {
116122
pm2.getVersion(function(err, remote_version) {
117123
if (!err && (pkg.version != remote_version)) {

0 commit comments

Comments
 (0)