Skip to content

Commit

Permalink
fix(git): Use absolute path instead (#264)
Browse files Browse the repository at this point in the history
Signed-off-by: Eric Bode <[email protected]>
  • Loading branch information
StealthyCoder authored Sep 12, 2023
1 parent 679afa7 commit 1065ca4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion subcommands/git/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"os/user"
"path/filepath"
"runtime"
"strings"

"github.com/foundriesio/fioctl/subcommands"
"github.com/sirupsen/logrus"
Expand Down Expand Up @@ -73,8 +74,10 @@ func doGitCreds(cmd *cobra.Command, args []string) {
helperName := "fio"
dst := filepath.Join(helperPath, GIT_CREDS_HELPER)
if runtime.GOOS == "windows" {
// To get around edge cases with git on Windows we use the absolute path
// So for example the following path will be used: C:/Program\\ Files/Git/bin/git-credential-fio.exe
dst += ".exe"
helperName += ".exe"
helperName = strings.ReplaceAll(filepath.ToSlash(dst), " ", "\\ ")
}

if len(sudoer) > 0 {
Expand Down

0 comments on commit 1065ca4

Please sign in to comment.