diff --git a/lib/API.js b/lib/API.js index 37b0fb44..ff2a1f96 100644 --- a/lib/API.js +++ b/lib/API.js @@ -833,17 +833,27 @@ API.prototype._startJson = function(file, opts, action, pipe, cb) { var apps_info = []; var that = this; - if (typeof(cb) === 'undefined' && typeof(pipe) === 'function') + if (typeof(cb) === 'undefined' && typeof(pipe) === 'function') { cb = pipe; + } - if (typeof(file) === 'object') + if (typeof(file) === 'object') { config = file; - else if (pipe == 'pipe') + } else if (pipe === 'pipe') { config = Common.parseConfig(file, 'pipe'); - else { + } else { var data = null; - var file_path = path.isAbsolute(file) ? file : path.join(that.cwd, file); + var isAbsolute = false + + //node 0.11 compatibility #2815 + if (typeof path.isAbsolute === 'function') { + isAbsolute = path.isAbsolute(file) + } else { + isAbsolute = /^\/|\\/.test(file) + } + + var file_path = isAbsolute ? file : path.join(that.cwd, file); debug('Resolved filepath %s', file_path);