chore: move homepage override and icon cache to $BASE_DIR/data, add migration code

This commit is contained in:
yusing
2025-04-14 06:26:26 +08:00
parent d8eff90acc
commit fa16f4150a
4 changed files with 135 additions and 3 deletions

16
migrations/utils.go Normal file
View File

@@ -0,0 +1,16 @@
package migrations
import (
"os"
"path/filepath"
)
func mv(old, new string) error {
if _, err := os.Stat(old); os.IsNotExist(err) {
return nil
}
if err := os.MkdirAll(filepath.Dir(new), 0o755); err != nil {
return err
}
return os.Rename(old, new)
}