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

Commit

Permalink
fix: handle backslash paths in repoInfo on Windows (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Pereira authored and felixfbecker committed Mar 18, 2019
1 parent 8427c06 commit e38a9f2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`)
}
Expand Down

0 comments on commit e38a9f2

Please sign in to comment.