Skip to content

Commit

Permalink
refactor: drop some 0.x patch
Browse files Browse the repository at this point in the history
  • Loading branch information
wallet77 committed Feb 27, 2018
1 parent 9552bd6 commit 0cab888
Showing 1 changed file with 5 additions and 25 deletions.
30 changes: 5 additions & 25 deletions lib/API.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
});
}
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 0cab888

Please sign in to comment.