Skip to content

Commit

Permalink
Merge 9-backup-config
Browse files Browse the repository at this point in the history
Write to a backup file when storing the config
  • Loading branch information
qrasmont authored Feb 27, 2022
2 parents 082a4a6 + 79e79c0 commit 9f39b6c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions project/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,13 @@ func storeConfig(config *Config, path string) error {
return err
}

// Create a config back-up as well
path = path + ".bak"
err = ioutil.WriteFile(path, str_file, 0644)
if err != nil {
return err
}

return nil
}

Expand Down

0 comments on commit 9f39b6c

Please sign in to comment.