diff --git a/rc/config.go b/rc/config.go index 67e3e15..6c7371c 100644 --- a/rc/config.go +++ b/rc/config.go @@ -19,6 +19,11 @@ type Config struct { Version int `yaml:"version"` Current string `yaml:"current"` Vaults map[string]*Vault `yaml:"vaults"` + Options Options `yaml:"options"` +} + +type Options struct { + ManageVaultToken bool `yaml:"manage_vault_token"` } type Vault struct { @@ -149,6 +154,9 @@ func (c *Config) Write() error { if err != nil { return err } + if c.Options.ManageVaultToken { + ioutil.WriteFile(fmt.Sprintf("%s/.vault-token", userHomeDir()), []byte(v.Token), 0600) + } return ioutil.WriteFile(svtoken(), b, 0600) }