mirror of
https://github.com/mitchell/selfpass.git
synced 2025-12-14 13:27:21 +00:00
Modify cmds that list metadata to not sort; refactor to credentials flags;
fix issue with init command
This commit is contained in:
parent
d42af8e859
commit
2969189d98
8 changed files with 135 additions and 65 deletions
|
|
@ -16,6 +16,8 @@ import (
|
|||
"github.com/mitchell/selfpass/sp/types"
|
||||
)
|
||||
|
||||
var ErrNoConfigFound = errors.New("no config found, run 'init' command")
|
||||
|
||||
func NewConfigManager(cfgFile *string) *ConfigManager {
|
||||
return &ConfigManager{
|
||||
cfgFile: cfgFile,
|
||||
|
|
@ -57,7 +59,7 @@ func (mgr *ConfigManager) OpenConfig() (output string, v *viper.Viper, err error
|
|||
var configDecrypted bool
|
||||
|
||||
if _, err := os.Open(cfg); os.IsNotExist(err) {
|
||||
return output, mgr.v, fmt.Errorf("no config found, run 'init' command")
|
||||
return output, mgr.v, ErrNoConfigFound
|
||||
}
|
||||
|
||||
prompt := &survey.Password{Message: "Master password:"}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue