refactor: drop some 0.x patch

This commit is contained in:
vince 2018-02-27 12:28:43 +01:00
parent 9552bd61b7
commit 0cab8880ff

View File

@ -185,22 +185,10 @@ class API {
if (that.pm2_home.indexOf('.pm2') > -1)
return cb(new Error('Destroy is not a allowed method on .pm2'));
if (fs.accessSync) {
fs.access(test_path, fs.R_OK, function(err) {
if (err) return cb(err);
debug('Deleting temporary folder %s', that.pm2_home);
exec(cmd, cb);
});
return false;
}
// Support for Node 0.10
fs.exists(test_path, function(exist) {
if (exist) {
debug('Deleting temporary folder %s', that.pm2_home);
exec(cmd, cb);
}
return cb(null);
fs.access(test_path, fs.R_OK, function(err) {
if (err) return cb(err);
debug('Deleting temporary folder %s', that.pm2_home);
exec(cmd, cb);
});
});
}
@ -858,15 +846,7 @@ class API {
} else {
var data = null;
var isAbsolute = false
//node 0.11 compatibility #2815
if (typeof path.isAbsolute === 'function') {
isAbsolute = path.isAbsolute(file)
} else {
isAbsolute = require('./tools/IsAbsolute.js')(file)
}
var isAbsolute = path.isAbsolute(file)
var file_path = isAbsolute ? file : path.join(that.cwd, file);
debug('Resolved filepath %s', file_path);