mirror of
https://github.com/Unitech/pm2.git
synced 2025-12-08 20:35:53 +00:00
Merge pull request #403 from sailxjx/bugfix/desc
fix crash in `pm2 desc id`
This commit is contained in:
commit
7b5110c40d
@ -8,6 +8,7 @@ var util = require('util');
|
||||
var cronJob = require('cron').CronJob;
|
||||
|
||||
var cst = require('../constants.js');
|
||||
var extItps = require('./interpreter.json');
|
||||
var p = path;
|
||||
|
||||
/**
|
||||
@ -35,6 +36,15 @@ Common.resolveAppPaths = function(app, cwd, outputter) {
|
||||
app.env = app.env || {};
|
||||
app.env.pm_cwd = cwd;
|
||||
|
||||
if (!app.exec_interpreter) {
|
||||
if (extItps[path.extname(app.script)]) {
|
||||
app.exec_interpreter = extItps[path.extname(app.script)];
|
||||
app.exec_mode = 'fork_mode';
|
||||
} else {
|
||||
app.exec_interpreter = 'node';
|
||||
}
|
||||
};
|
||||
|
||||
if (!('exec_mode' in app)) app['exec_mode'] = 'cluster_mode';
|
||||
|
||||
app["pm_exec_path"] = path.resolve(cwd, app.script);
|
||||
@ -44,7 +54,6 @@ Common.resolveAppPaths = function(app, cwd, outputter) {
|
||||
app["name"] = p.basename(app["pm_exec_path"]);
|
||||
}
|
||||
|
||||
|
||||
if (fs.existsSync(app.pm_exec_path) == false) {
|
||||
return new Error('script not found : ' + app.pm_exec_path);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user