Skip to content
This repository was archived by the owner on Mar 10, 2022. It is now read-only.

Commit e38a9f2

Browse files
Daniel Pereirafelixfbecker
authored andcommitted
fix: handle backslash paths in repoInfo on Windows (#23)
1 parent 8427c06 commit e38a9f2

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/git.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ export async function repoInfo(filePath: string): Promise<[string, string, strin
6969
fileRel = filePath.slice(repoRoot.length + 1)
7070
remoteURL = await gitDefaultRemoteURL(repoRoot)
7171
branch = await gitBranch(repoRoot)
72+
if (process.platform === 'win32') {
73+
fileRel = fileRel.replace(/\\/g, '/')
74+
}
7275
} catch (e) {
7376
log.appendLine(`repoInfo(${filePath}): ${e}`)
7477
}

0 commit comments

Comments
 (0)