不要怂,就是干,撸起袖子干!

Commit b558440c by Sean Arme

Bug fix - corrected detection of relative paths in import function.

Original check was using "path.sep" (which is undefined) instead of "Path.sep".  Also, the check failed to catch absolute paths in Windows when the path starts with a drive letter (ex. "C:\folder\file.js").
1 parent dc07afa3
Showing with 1 additions and 1 deletions
...@@ -280,7 +280,7 @@ module.exports = (function() { ...@@ -280,7 +280,7 @@ module.exports = (function() {
Sequelize.prototype.import = function(path) { Sequelize.prototype.import = function(path) {
// is it a relative path? // is it a relative path?
if (Path.normalize(path).indexOf(path.sep) !== 0) { if(Path.normalize(path) !== Path.resolve(path)){
// make path relative to the caller // make path relative to the caller
var callerFilename = Utils.stack()[1].getFileName() var callerFilename = Utils.stack()[1].getFileName()
, callerPath = Path.dirname(callerFilename) , callerPath = Path.dirname(callerFilename)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!