Skip to content

Commit

Permalink
Fix path issues with forward slashes on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
ivogabe committed Oct 27, 2016
1 parent 2d2b0f2 commit 5e83d5a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import Vinyl = require('vinyl');
import chalk = require('chalk');

import project = require('./project');
import { pathsEqual } from './io';
export import Project = project.Project;
export import ProjectOptions = project.ProjectOptions;

Expand Down Expand Up @@ -110,7 +111,7 @@ export function gulp(startFileName: string = 'index.js', options: GulpOptions =
}

fileNames.push(file.relative);
if (file.relative === startFileName) {
if (pathsEqual(file.relative, startFileName)) {
gulpCompile(file);
}
});
Expand Down
2 changes: 1 addition & 1 deletion lib/io.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ interface VinylSourcemap extends Vinyl {

export function normalizePath(path: string) {
if (!path) return path;
return path.toLowerCase().replace(/\\/, '/');
return path.toLowerCase().replace(/\\/g, '/');
}
export function pathsEqual(a: string, b: string) {
return normalizePath(a) === normalizePath(b);
Expand Down

0 comments on commit 5e83d5a

Please sign in to comment.