Make sure fix for issue #7 works in Windows too (check for backslash in path)

This commit is contained in:
Rosa Tse 2012-02-06 14:58:46 -05:00
parent a31e8029cd
commit e5a368d67a

View file

@ -267,6 +267,10 @@ var mkdirSyncRecursive = function(path, mode) {
} catch(err) {
if(err.code == "ENOENT") {
var slashIdx = path.lastIndexOf("/");
if(slashIdx < 0) {
slashIdx = path.lastIndexOf("\\");
}
if(slashIdx > 0) {
var parentPath = path.substring(0, slashIdx);
mkdirSyncRecursive(parentPath, mode);