all: Fix versioning path handling (#7407)
This commit is contained in:
@@ -27,6 +27,7 @@ import (
|
||||
// put the newest on top for readability.
|
||||
var (
|
||||
migrations = migrationSet{
|
||||
{35, migrateToConfigV35},
|
||||
{34, migrateToConfigV34},
|
||||
{33, migrateToConfigV33},
|
||||
{32, migrateToConfigV32},
|
||||
@@ -93,6 +94,24 @@ func (m migration) apply(cfg *Configuration) {
|
||||
cfg.Version = m.targetVersion
|
||||
}
|
||||
|
||||
func migrateToConfigV35(cfg *Configuration) {
|
||||
for i, fcfg := range cfg.Folders {
|
||||
params := fcfg.Versioning.Params
|
||||
if params["fsType"] != "" {
|
||||
var fsType fs.FilesystemType
|
||||
_ = fsType.UnmarshalText([]byte(params["fsType"]))
|
||||
cfg.Folders[i].Versioning.FSType = fsType
|
||||
}
|
||||
if params["versionsPath"] != "" && params["fsPath"] == "" {
|
||||
params["fsPath"] = params["versionsPath"]
|
||||
}
|
||||
cfg.Folders[i].Versioning.FSPath = params["fsPath"]
|
||||
delete(cfg.Folders[i].Versioning.Params, "fsType")
|
||||
delete(cfg.Folders[i].Versioning.Params, "fsPath")
|
||||
delete(cfg.Folders[i].Versioning.Params, "versionsPath")
|
||||
}
|
||||
}
|
||||
|
||||
func migrateToConfigV34(cfg *Configuration) {
|
||||
cfg.Defaults.Folder.Path = cfg.Options.DeprecatedDefaultFolderPath
|
||||
cfg.Options.DeprecatedDefaultFolderPath = ""
|
||||
|
||||
Reference in New Issue
Block a user