Skip to content

Commit

Permalink
fix: msys2 compatibility
Browse files Browse the repository at this point in the history
resolves #281
  • Loading branch information
JanDeDobbeleer committed Dec 29, 2020
1 parent 9013a5b commit 0e7849c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main.go
Expand Up @@ -176,6 +176,10 @@ func initShell(shell, config string) string {

func printShellInit(shell, config string) string {
executable, err := os.Executable()
// On Windows, it fails when the excutable is called in MSYS2 for example
// which uses unix style paths to resolve the executable's location.
// PowerShell knows how to resolve both, so we can swap this without any issue.
executable = strings.ReplaceAll(executable, "\\", "/")
if err != nil {
return noExe
}
Expand Down

0 comments on commit 0e7849c

Please sign in to comment.