diff --git a/core/core.go b/core/core.go index 3709cfb2..e49b84fb 100644 --- a/core/core.go +++ b/core/core.go @@ -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") }