Skip to content

Commit c912271

Browse files
committed
Merge pull request #700 from li-qiang/master
Fix bug for windows path
2 parents acc5887 + 45dde7b commit c912271

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

lib/Utilities.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -282,9 +282,9 @@ exports.getRealPath = function (path_str, stack_index) {
282282
} else if ((m = tmp.match(/^\s*at\s+.+\s+\((.+):\d+:\d+\)$/)) !== null) {
283283
cwd = path.dirname(m[1]);
284284
}
285-
286-
if (path_str[0] !== path.sep) {
287-
path_str = cwd + "/" + path_str;
285+
var pathIsAbsolute = path.isAbsolute || require('path-is-absolute');
286+
if (!pathIsAbsolute(path_str)) {
287+
path_str = path.join(cwd, path_str);
288288
}
289289
if (path_str.substr(-1) === path.sep) {
290290
path_str += "index";

package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,12 @@
3636
},
3737
"analyse" : false,
3838
"dependencies": {
39-
"enforce" : "0.1.6",
40-
"sql-query" : "0.1.26",
41-
"sql-ddl-sync" : "0.3.11",
42-
"hat" : "0.0.3",
43-
"lodash" : "2.4.1"
39+
"enforce" : "0.1.6",
40+
"sql-query" : "0.1.26",
41+
"sql-ddl-sync" : "0.3.11",
42+
"hat" : "0.0.3",
43+
"lodash" : "2.4.1",
44+
"path-is-absolute" : "1.0.0"
4445
},
4546
"devDependencies": {
4647
"mysql" : "2.9.0",

0 commit comments

Comments
 (0)