Fixes pathing issue on Windows

This commit is contained in:
Eric Amodio
2017-02-16 21:15:39 -05:00
parent afe8d38fdb
commit 305674d71a

View File

@@ -47,13 +47,17 @@ export default class Git {
} }
static splitPath(fileName: string, repoPath?: string): [string, string] { static splitPath(fileName: string, repoPath?: string): [string, string] {
// if (!path.isAbsolute(fileName)) { if (repoPath) {
// Logger.error(`Git.splitPath(${fileName}) is not an absolute path!`); return [
// debugger; fileName.replace(repoPath.endsWith('/') ? repoPath : `${repoPath}/`, ''),
// } repoPath
if (repoPath) return [fileName.replace(`${repoPath}/`, ''), repoPath]; ];
}
return [path.basename(fileName).replace(/\\/g, '/'), path.dirname(fileName).replace(/\\/g, '/')]; return [
path.basename(fileName).replace(/\\/g, '/'),
path.dirname(fileName).replace(/\\/g, '/')
];
} }
static async repoPath(cwd: string, gitPath?: string) { static async repoPath(cwd: string, gitPath?: string) {