mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-21 07:51:28 +02:00
chore: move homepage override and icon cache to $BASE_DIR/data, add migration code
This commit is contained in:
16
migrations/utils.go
Normal file
16
migrations/utils.go
Normal 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)
|
||||
}
|
||||
Reference in New Issue
Block a user