mirror of
https://github.com/Unitech/pm2.git
synced 2025-12-08 20:35:53 +00:00
refactor: drop some 0.x patch
This commit is contained in:
parent
9552bd61b7
commit
0cab8880ff
30
lib/API.js
30
lib/API.js
@ -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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user