From e38a9f2c86e774609121a443f0b589bb78241582 Mon Sep 17 00:00:00 2001 From: Daniel Pereira Date: Mon, 18 Mar 2019 17:39:37 -0500 Subject: [PATCH] fix: handle backslash paths in repoInfo on Windows (#23) --- src/git.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/git.ts b/src/git.ts index 5dd5bd1a..0e0d2db3 100644 --- a/src/git.ts +++ b/src/git.ts @@ -69,6 +69,9 @@ export async function repoInfo(filePath: string): Promise<[string, string, strin fileRel = filePath.slice(repoRoot.length + 1) remoteURL = await gitDefaultRemoteURL(repoRoot) branch = await gitBranch(repoRoot) + if (process.platform === 'win32') { + fileRel = fileRel.replace(/\\/g, '/') + } } catch (e) { log.appendLine(`repoInfo(${filePath}): ${e}`) }