Fixes #4 - Absolute paths fail on Windows due to backslash

This commit is contained in:
Eric Amodio
2016-09-14 00:55:48 -04:00
parent a2eee23d7f
commit 87215850b7

View File

@@ -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) {