mirror of
https://github.com/dnote/dnote
synced 2026-03-14 22:45:50 +01:00
Backup in beta release
This commit is contained in:
parent
19d383ac90
commit
9043dbe495
1 changed files with 6 additions and 1 deletions
|
|
@ -17,7 +17,7 @@ import (
|
|||
|
||||
const (
|
||||
// Version is the current version of dnote
|
||||
Version = "0.2.0-beta"
|
||||
Version = "0.2.0-alpha"
|
||||
|
||||
// TimestampFilename is the name of the file containing upgrade info
|
||||
TimestampFilename = "timestamps"
|
||||
|
|
@ -450,6 +450,11 @@ func MigrateToDnoteDir(ctx infra.DnoteCtx) error {
|
|||
return errors.Wrap(err, "Failed to make temporary .dnote directory")
|
||||
}
|
||||
|
||||
// In the beta release for v0.2, backup user's .dnote
|
||||
if err := utils.CopyFile(oldDnotePath, fmt.Sprintf("%s/dnote-bak-5cdde2e83", homeDir)); err != nil {
|
||||
return errors.Wrap(err, "Failed to back up the old .dnote file")
|
||||
}
|
||||
|
||||
if err := os.Rename(oldDnotePath, fmt.Sprintf("%s/dnote", temporaryDirPath)); err != nil {
|
||||
return errors.Wrap(err, "Failed to move .dnote file")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue