Fix stuff

This commit is contained in:
Kim "BKC" Carlbäcker
2017-04-28 21:36:35 +02:00
parent 77ef39112d
commit b0c7a3bb5c
2 changed files with 31 additions and 17 deletions

View File

@@ -70,7 +70,10 @@ var Backup = cli.Command{
},
}
const archiveRootDir = "gitea-backup"
const (
archiveRootDir = "gitea-backup"
backupVersion = 1
)
func runBackup(c *cli.Context) error {
zip.Verbose = c.Bool("verbose")
@@ -100,7 +103,7 @@ func runBackup(c *cli.Context) error {
// Metadata
metaFile := path.Join(rootDir, "metadata.ini")
metadata := ini.Empty()
metadata.Section("").Key("VERSION").SetValue("1")
metadata.Section("").Key("VERSION").SetValue(fmt.Sprintf("%d", backupVersion))
metadata.Section("").Key("DATE_TIME").SetValue(time.Now().String())
metadata.Section("").Key("GITEA_VERSION").SetValue(setting.AppVer)
if err = metadata.SaveTo(metaFile); err != nil {