Skip to content

Commit

Permalink
select funtion for path absolute
Browse files Browse the repository at this point in the history
  • Loading branch information
li-qiang committed Jan 25, 2016
1 parent c6c895b commit 45dde7b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/Utilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,6 @@ exports.convertPropToJoinKeyProp = function (props, opts) {

exports.getRealPath = function (path_str, stack_index) {
var path = require("path"); // for now, load here (only when needed)
var pathIsAbsolute = require('path-is-absolute');
var cwd = process.cwd();
var err = new Error();
var tmp = err.stack.split(/\r?\n/)[typeof stack_index !== "undefined" ? stack_index : 3], m;
Expand All @@ -283,7 +282,7 @@ exports.getRealPath = function (path_str, stack_index) {
} else if ((m = tmp.match(/^\s*at\s+.+\s+\((.+):\d+:\d+\)$/)) !== null) {
cwd = path.dirname(m[1]);
}

var pathIsAbsolute = path.isAbsolute || require('path-is-absolute');
if (!pathIsAbsolute(path_str)) {
path_str = path.join(cwd, path_str);
}
Expand Down

0 comments on commit 45dde7b

Please sign in to comment.