Skip to content

Commit

Permalink
Fixes #4 - Absolute paths fail on Windows due to backslash
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Amodio committed Sep 14, 2016
1 parent a2eee23 commit 8721585
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ function gitCommand(cwd: string, ...args) {

export default class Git {
static normalizePath(fileName: string, repoPath: string) {
fileName = fileName.replace(/\\/g, '/');
return isAbsolute(fileName) ? relative(repoPath, fileName) : fileName;
return (isAbsolute(fileName) ? relative(repoPath, fileName) : fileName).replace(/\\/g, '/');
}

static repoPath(cwd: string) {
Expand Down

0 comments on commit 8721585

Please sign in to comment.