mirror of
https://github.com/passbolt/go-passbolt-cli.git
synced 2025-05-12 02:58:20 +00:00
fix #3 userprivatekeyfile flag not always working
This commit is contained in:
parent
0449e9983c
commit
fa4d395a02
1 changed files with 3 additions and 1 deletions
|
@ -97,7 +97,7 @@ func initConfig() {
|
|||
|
||||
// Read in Private Key from File if userprivatekeyfile is set
|
||||
userprivatekeyfile, err := rootCmd.PersistentFlags().GetString("userPrivateKeyFile")
|
||||
if err != nil && userprivatekeyfile != "" {
|
||||
if err == nil && userprivatekeyfile != "" {
|
||||
if viper.GetBool("debug") {
|
||||
fmt.Fprintln(os.Stderr, "Loading Private Key from File:", userprivatekeyfile)
|
||||
}
|
||||
|
@ -107,5 +107,7 @@ func initConfig() {
|
|||
os.Exit(1)
|
||||
}
|
||||
viper.Set("userprivatekey", string(content))
|
||||
} else if err != nil && viper.GetBool("debug") {
|
||||
fmt.Fprintln(os.Stderr, "Getting Private Key File Flag:", err)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue