Skip to content

Commit

Permalink
Rename onepassword config var to match command
Browse files Browse the repository at this point in the history
  • Loading branch information
twpayne committed Jan 28, 2019
1 parent 13f5d47 commit d7be60a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cmd/config.go
Expand Up @@ -42,7 +42,7 @@ type Config struct {
Bitwarden bitwardenCmdConfig
GenericSecret genericSecretCmdConfig
Lastpass lastpassCmdConfig
OnePassword onepasswordCmdConfig
Onepassword onepasswordCmdConfig
Vault vaultCmdConfig
Pass passCmdConfig
Data map[string]interface{}
Expand Down
2 changes: 1 addition & 1 deletion cmd/doctor.go
Expand Up @@ -107,7 +107,7 @@ func (c *Config) runDoctorCmd(fs vfs.FS, args []string) error {
vcsCommandCheck,
&doctorBinaryCheck{
name: "1Password CLI",
binaryName: c.OnePassword.Op,
binaryName: c.Onepassword.Op,
versionArgs: []string{"--version"},
versionRegexp: regexp.MustCompile(`^(\d+\.\d+\.\d+)`),
},
Expand Down
6 changes: 3 additions & 3 deletions cmd/secret_onepassword.go
Expand Up @@ -24,21 +24,21 @@ type onepasswordCmdConfig struct {
var onepasswordCache = make(map[string]interface{})

func init() {
config.OnePassword.Op = "op"
config.Onepassword.Op = "op"
config.addTemplateFunc("onepassword", config.onepasswordFunc)

secretCmd.AddCommand(onepasswordCmd)
}

func (c *Config) runOnepasswordCmd(fs vfs.FS, args []string) error {
return c.exec(append([]string{c.OnePassword.Op}, args...))
return c.exec(append([]string{c.Onepassword.Op}, args...))
}

func (c *Config) onepasswordFunc(item string) interface{} {
if data, ok := onepasswordCache[item]; ok {
return data
}
name := c.OnePassword.Op
name := c.Onepassword.Op
args := []string{"get", "item", item}
if c.Verbose {
fmt.Printf("%s %s\n", name, strings.Join(args, " "))
Expand Down

0 comments on commit d7be60a

Please sign in to comment.