Use os.UserHomeDir instead of user.Current to avoid depedency to cgo (#119)
Co-authored-by: Loric Brevet <loric.brevet@amersports.com>
This commit is contained in:
@@ -4,7 +4,6 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
"os/user"
|
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
|
||||||
"github.com/browserpass/browserpass-native/errors"
|
"github.com/browserpass/browserpass-native/errors"
|
||||||
@@ -148,12 +147,12 @@ func getDefaultPasswordStorePath() (string, error) {
|
|||||||
return path, nil
|
return path, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
usr, err := user.Current()
|
home, err := os.UserHomeDir()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
|
||||||
path = filepath.Join(usr.HomeDir, ".password-store")
|
path = filepath.Join(home, ".password-store")
|
||||||
return path, nil
|
return path, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user