Skip to content

Commit

Permalink
Merge pull request #109 from merrickluo/password-store-dir
Browse files Browse the repository at this point in the history
pass backend: use PASSWORD_STORE_DIR if set
  • Loading branch information
mtibben committed Mar 7, 2022
2 parents 7098185 + e99e39c commit ecf5c8e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pass.go
Expand Up @@ -24,7 +24,11 @@ func init() {
pass.passcmd = "pass"
}
if cfg.PassDir == "" {
pass.dir = filepath.Join(os.Getenv("HOME"), ".password-store")
if passDir, found := os.LookupEnv("PASSWORD_STORE_DIR"); found {
pass.dir = passDir
} else {
pass.dir = filepath.Join(os.Getenv("HOME"), ".password-store")
}
} else if strings.HasPrefix(pass.dir, "~") {
if len(pass.dir) > 1 && pass.dir[1] != '/' {
return nil, fmt.Errorf("Cannot expand path: %s", pass.dir)
Expand Down

0 comments on commit ecf5c8e

Please sign in to comment.