Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(git): expand user home dir first #437

Merged
merged 1 commit into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions subcommands/docker/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ func doDockerCreds(cmd *cobra.Command, args []string) {
configBytes, err := subcommands.MarshalIndent(config, "", " ")
subcommands.DieNotNil(err)

if strings.Contains(helperPath, "~/") {
subcommands.DieNotNil(fmt.Errorf("~ character is not supported in --creds-path=. Try to run it as --creds-path %s", helperPath))
}
dst := filepath.Join(helperPath, DOCKER_CREDS_HELPER)
if runtime.GOOS == "windows" {
dst += ".exe"
Expand Down
7 changes: 4 additions & 3 deletions subcommands/git/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ import (

const GIT_CREDS_HELPER = "git-credential-fio"

var (
helperPath string
)
var helperPath string

func NewCommand() *cobra.Command {
path, err := exec.LookPath("git")
Expand Down Expand Up @@ -74,6 +72,9 @@ func doGitCreds(cmd *cobra.Command, args []string) {
var gitHelperCommandArgs []string

helperName := "fio"
if strings.Contains(helperPath, "~/") {
subcommands.DieNotNil(fmt.Errorf("~ character is not supported in --creds-path=. Try to run it as --creds-path %s", helperPath))
}
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
Expand Down
Loading