mirror of
https://github.com/yusing/godoxy.git
synced 2025-05-20 12:42:34 +02:00
16 lines
262 B
Go
16 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)
|
|
}
|