Skip to content

Commit

Permalink
Change backup path to fit win
Browse files Browse the repository at this point in the history
  • Loading branch information
Raggaer committed Feb 27, 2019
1 parent 3c1dd5f commit 38e7a3c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions save.go
Expand Up @@ -49,7 +49,8 @@ func saveDatabase() error {
if err := encoder.Encode(database); err != nil { if err := encoder.Encode(database); err != nil {
return err return err
} }
return openDatabaseFile(databaseLocation) database.UnlockProtectedEntries()
return nil
} }


func backupDatabase() error { func backupDatabase() error {
Expand All @@ -59,7 +60,7 @@ func backupDatabase() error {
} }
defer src.Close() defer src.Close()
dir, file := filepath.Split(databaseLocation) dir, file := filepath.Split(databaseLocation)
backupName := filepath.Join(dir, time.Now().Format("2006-01-02_15:04:05")+"_"+file) backupName := filepath.Join(dir, time.Now().Format("2006-01-02_15-04-05")+"_"+file)
dst, err := os.Create(backupName) dst, err := os.Create(backupName)
if err != nil { if err != nil {
return err return err
Expand Down

0 comments on commit 38e7a3c

Please sign in to comment.