1
0
mirror of https://github.com/docker/docker-credential-helpers.git synced 2026-06-15 17:02:27 +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/exec"
"path"
"path/filepath"
"strings"
"sync"
@@ -104,11 +105,11 @@ func (p Pass) Delete(serverURL string) error {
}
func getPassDir() string {
passDir := "$HOME/.password-store"
if envDir := os.Getenv("PASSWORD_STORE_DIR"); envDir != "" {
passDir = envDir
if passDir := os.Getenv("PASSWORD_STORE_DIR"); passDir != "" {
return passDir
}
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.