Skip to content

Commit

Permalink
fix: restrict WriteConfigField to atomic writes (#1109)
Browse files Browse the repository at this point in the history
  • Loading branch information
charliecruzan-stripe committed Jul 25, 2023
1 parent 82228c0 commit a2a9670
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pkg/config/profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ func (p *Profile) RegisterAlias(alias, key string) {
// WriteConfigField updates a configuration field and writes the updated
// configuration to disk.
func (p *Profile) WriteConfigField(field, value string) error {
viper.ReadInConfig()
viper.Set(p.GetConfigField(field), value)
return viper.WriteConfig()
}
Expand Down

0 comments on commit a2a9670

Please sign in to comment.