1
0
mirror of https://github.com/docker/docker-credential-helpers.git synced 2026-06-15 08:52:10 +05:30

Merge pull request #287 from thaJeztah/pass_no_interpolate

pass: fix interpolation of $PASSWORD_STORE_DIR, and use os.UserHomeDir()
This commit is contained in:
CrazyMax
2023-05-29 12:02:13 +02:00
committed by GitHub
+5 -4
View File
@@ -13,6 +13,7 @@ import (
"os" "os"
"os/exec" "os/exec"
"path" "path"
"path/filepath"
"strings" "strings"
"sync" "sync"
@@ -104,11 +105,11 @@ func (p Pass) Delete(serverURL string) error {
} }
func getPassDir() string { func getPassDir() string {
passDir := "$HOME/.password-store" if passDir := os.Getenv("PASSWORD_STORE_DIR"); passDir != "" {
if envDir := os.Getenv("PASSWORD_STORE_DIR"); envDir != "" { return passDir
passDir = envDir
} }
return os.ExpandEnv(passDir) home, _ := os.UserHomeDir()
return filepath.Join(home, ".password-store")
} }
// listPassDir lists all the contents of a directory in the password store. // listPassDir lists all the contents of a directory in the password store.