Comparing version 0.0.6 to 0.0.7
0.0.7 / 2013-09-25 | ||
================== | ||
* Normalize windows paths correctly | ||
* On Windows lib/detector.js not adding trailing slash when needed. | ||
0.0.6 / 2013-09-13 | ||
@@ -3,0 +9,0 @@ ================== |
@@ -25,3 +25,14 @@ /** | ||
if (process.platform !== "win32" && last !== '/') { | ||
if (process.platform !== "win32") { | ||
if (last !== '/') { | ||
path += '/'; | ||
} | ||
} else { | ||
//This is fine b/c Windows will | ||
//correctly resolve filepaths with additional slashes | ||
//and it is not correct to assume that on Windows the value | ||
//of path will be a string that terminates in '\'. | ||
// | ||
//See: http://stackoverflow.com/questions/4158597/extra-slashes-in-path-variable-of-file-copy-or-directory-createdirectory-met | ||
// | ||
path += '/'; | ||
@@ -45,2 +56,4 @@ } | ||
return normalize(temp); | ||
}; | ||
}; | ||
detector._normalize = normalize; |
{ | ||
"name": "temporary" | ||
, "version": "0.0.6" | ||
, "version": "0.0.7" | ||
, "description": "The lord of tmp." | ||
@@ -5,0 +5,0 @@ , "keywords": ["tmp", "temp", "tempfile", "tempdirectory"] |
@@ -23,3 +23,19 @@ /** | ||
}); | ||
it('should normalize windows paths correctly', function () { | ||
var platform_noConflict = process.platform; | ||
process.platform = 'win32'; | ||
detector._normalize('c:\\windows\\foo\\bar\\') | ||
.should.eql('c:\\windows\\foo\\bar\\/'); | ||
detector._normalize('c:/windows/foo/bar/') | ||
.should.eql('c:/windows/foo/bar//'); | ||
detector._normalize('c:/windows/foo/bar') | ||
.should.eql('c:/windows/foo/bar/'); | ||
detector._normalize('c:\\windows\\foo\\bar') | ||
.should.eql('c:\\windows\\foo\\bar/'); | ||
process.platform = platform_noConflict; | ||
}); | ||
}); | ||
}); | ||
19101
634