mirror of
https://github.com/Jguer/yay
synced 2024-09-14 13:51:12 +00:00
Prevent file corruption by truncating the files
This commit is contained in:
parent
878c606556
commit
34d0f372fd
|
@ -87,7 +87,7 @@ func readAlpmConfig(pacmanconf string) (conf alpm.PacmanConfig, err error) {
|
|||
func (config *Configuration) saveConfig() error {
|
||||
config.NoConfirm = false
|
||||
marshalledinfo, _ := json.MarshalIndent(config, "", "\t")
|
||||
in, err := os.OpenFile(configFile, os.O_RDWR|os.O_CREATE, 0644)
|
||||
in, err := os.OpenFile(configFile, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0644)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue