Make a copy of config before overriding it

This commit is contained in:
Jan
2022-02-09 20:35:29 +01:00
parent 27758a03fa
commit 65ba1f6ac1
2 changed files with 3 additions and 3 deletions

View File

@@ -60,13 +60,13 @@ func ExecuteResticCommand(options ExecuteOptions, args ...string) (string, error
}
func CopyFile(from, to string) error {
original, err := os.Open("original.txt")
original, err := os.Open(from)
if err != nil {
return nil
}
defer original.Close()
new, err := os.Create("new.txt")
new, err := os.Create(to)
if err != nil {
return nil
}