remove io-js dependency - add execution of executable in PATH

This commit is contained in:
Unitech 2015-08-10 16:19:41 +02:00
parent 1d6707995e
commit f916f41ec6
4 changed files with 31 additions and 9 deletions

View File

@ -3,6 +3,12 @@
- New flag `--no-pmx` : starts an app without injecting pmx
- New feature : cron restart now works in fork mode as well
# 0.14.7
- Disable auto-gc on interactor
- Allow PM2 to execute binaries in $PATH
- pm2 link priv pub --recyle for elastic infrastructure
# 0.14.6
- Scoped PM2 actions

View File

@ -11,11 +11,10 @@ var Utility = require('./Utility.js');
var async = require('async');
var cst = require('../constants.js');
var extItps = require('./interpreter.json');
var shelljs = require('shelljs');
var p = path;
var Satan = require('./Satan.js');
var iojs = require('is-iojs');
var InteractorDaemonizer = require('./Interactor/InteractorDaemonizer.js');
/**
@ -37,10 +36,6 @@ Common.prepareAppConf = function(app, cwd, outputter) {
* Check if PM2 is runned with iojs to handle next-gen-js
*/
if (app.next_gen_js) {
// if (!iojs) {
// return new Error('To run next generation Javascript you need to run PM2 with io.js');
// }
// If fork mode set the right interpreter
if ((app.exec_mode == 'fork_mode' ||
app.exec_mode == 'fork' ||
@ -76,12 +71,18 @@ Common.prepareAppConf = function(app, cwd, outputter) {
cwd = cwd || process.cwd();
app.pm_exec_path = p.resolve(cwd, app.script);
delete app.script;
if (!fs.existsSync(app.pm_exec_path)) {
return new Error('script not found : ' + app.pm_exec_path);
var ckd;
// Resolve command
if (ckd = shelljs.which(app.script))
app.pm_exec_path = ckd;
else
return new Error('script not found : ' + app.pm_exec_path);
}
delete app.script;
// Set current env by first adding the process environment and then extending/replacing it
// with env specified on command-line or JSON file.
app.env = [{}, process.env, app.env || {}, {pm_cwd: cwd}].reduce(function(e1, e2){

View File

@ -119,6 +119,8 @@
"node-pm2",
"production",
"keymetrics",
"node.js monitoring",
"strong-pm",
"deploy",
"deployment",
"daemon",
@ -130,6 +132,8 @@
"monitoring",
"process manager",
"forever",
"profiling",
"probes",
"forever-monitor",
"keep process alive",
"process configuration",
@ -169,7 +173,6 @@
"safe-clone-deep" : "1.0.5",
"babel" : "^5.x",
"is-iojs" : "1.1.0",
"shelljs" : "0.5.1",
"isbinaryfile" : "^3.0.0",

View File

@ -42,3 +42,15 @@ OUT=$(getInterpreter)
success "$1"
$pm2 kill
#
# Should execute command in $PATH
#
$pm2 start ls
spec "Should script started"
OUT=$(getInterpreter)
[ $OUT="none" ] || fail "$1"
success "Right interpreter"
should 'Have the right relative path' '/bin/ls' 1