Skip to content

Commit

Permalink
Replace backslashes on Windows #534
Browse files Browse the repository at this point in the history
  • Loading branch information
tommy351 committed Mar 16, 2014
1 parent 54cdd40 commit 99b1d65
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
12 changes: 8 additions & 4 deletions lib/box/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,14 @@ Box.prototype._dispatch = function(type, path, callback){

var self = this;

// Replace backslashes on Windows
path = path.replace(/\\/g, '/');

// Skip processing files
if (this.processingFiles[path]) return callback();

this.processingFiles[path] = true;

async.each(this.processors, function(processor, next){
if (!processor.pattern.test(path)) return next();

Expand Down Expand Up @@ -191,10 +199,6 @@ Box.prototype.process = function(files, callback){
type = 'update';
}

// Skip the processing file
if (self.processingFiles[path]) return;

self.processingFiles[path] = true;
self._dispatch(type, path, next);
}, next);
}
Expand Down
3 changes: 3 additions & 0 deletions lib/theme/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ Theme.prototype.generate = function(options, callback){
* @return {Theme.View}
*/
Theme.prototype.getView = function(path){
// Replace backslashes on Windows
path = path.replace(/\\/g, '/');

var extname = pathFn.extname(path),
name = path.substring(0, path.length - extname.length),
views = this.views[path];
Expand Down

0 comments on commit 99b1d65

Please sign in to comment.