mirror of
https://github.com/Unitech/pm2.git
synced 2025-12-08 20:35:53 +00:00
fix calling PM2 inside a script #4761
This commit is contained in:
parent
e790d82212
commit
374fd39072
@ -206,12 +206,11 @@ Common.prepareAppConf = function(opts, app) {
|
||||
}
|
||||
|
||||
app.env = [
|
||||
{}, app.filter_env ? filterEnv(process.env) : env, app.env || {}
|
||||
{}, (app.filter_env && app.filter_env.length > 0) ? filterEnv(process.env) : env, app.env || {}
|
||||
].reduce(function(e1, e2){
|
||||
return util._extend(e1, e2);
|
||||
});
|
||||
|
||||
|
||||
app.pm_cwd = cwd;
|
||||
// Interpreter
|
||||
try {
|
||||
@ -544,7 +543,7 @@ Common.safeExtend = function(origin, add){
|
||||
if (!add || typeof add != 'object') return origin;
|
||||
|
||||
//Ignore PM2's set environment variables from the nested env
|
||||
var keysToIgnore = ['name', 'exec_mode', 'env', 'args', 'pm_cwd', 'exec_interpreter', 'pm_exec_path', 'node_args', 'pm_out_log_path', 'pm_err_log_path', 'pm_pid_path', 'pm_id', 'status', 'pm_uptime', 'created_at', 'windowsHide', 'username', 'merge_logs', 'kill_retry_time', 'prev_restart_delay', 'instance_var', 'unstable_restarts', 'restart_time', 'axm_actions', 'pmx_module', 'command', 'watch', 'versioning', 'vizion_runing', 'MODULE_DEBUG', 'pmx', 'axm_options', 'created_at', 'watch', 'vizion', 'axm_dynamic', 'axm_monitor', 'instances', 'automation', 'autorestart', 'unstable_restart', 'treekill', 'exit_code', 'vizion'];
|
||||
var keysToIgnore = ['name', 'exec_mode', 'env', 'args', 'pm_cwd', 'exec_interpreter', 'pm_exec_path', 'node_args', 'pm_out_log_path', 'pm_err_log_path', 'pm_pid_path', 'pm_id', 'status', 'pm_uptime', 'created_at', 'windowsHide', 'username', 'merge_logs', 'kill_retry_time', 'prev_restart_delay', 'instance_var', 'unstable_restarts', 'restart_time', 'axm_actions', 'pmx_module', 'command', 'watch', 'filter_env', 'versioning', 'vizion_runing', 'MODULE_DEBUG', 'pmx', 'axm_options', 'created_at', 'watch', 'vizion', 'axm_dynamic', 'axm_monitor', 'instances', 'automation', 'autorestart', 'unstable_restart', 'treekill', 'exit_code', 'vizion'];
|
||||
|
||||
var keys = Object.keys(add);
|
||||
var i = keys.length;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user