mirror of
https://github.com/yusing/godoxy.git
synced 2026-03-17 23:03:49 +01:00
17 lines
262 B
Go
17 lines
262 B
Go
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)
|
|
}
|