Skip to content

Commit baeec34

Browse files
committed
pm2 configuration file in /etc/pm2 when installed with packager
1 parent 545f049 commit baeec34

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

packager/build-dist.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ tar -xzf pack.tgz --strip 1
1313
rm -rf pack.tgz
1414
npm install npm --save
1515
npm install --production
16+
sed -i '1iconst PKG_INSTALL=true;' paths.js
1617
cd ..
1718

1819
# First run that print a banner

paths.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
const PKG_INSTALL=false;
12

23
/**
34
* Copyright 2013 the PM2 project authors. All rights reserved.
@@ -11,7 +12,9 @@ var p = require('path');
1112
function getDefaultPM2Home() {
1213
var PM2_ROOT_PATH;
1314

14-
if (process.env.PM2_HOME)
15+
if (PKG_INSTALL === true && !process.env.PM2_HOME)
16+
PM2_ROOT_PATH = p.resolve('/etc', 'pm2');
17+
else if (process.env.PM2_HOME)
1518
PM2_ROOT_PATH = process.env.PM2_HOME;
1619
else if (process.env.HOME && !process.env.HOMEPATH)
1720
PM2_ROOT_PATH = p.resolve(process.env.HOME, '.pm2');

0 commit comments

Comments
 (0)