mirror of
https://github.com/zu1k/nali.git
synced 2025-02-02 10:22:41 +08:00
fix: migration find old dir path
Signed-off-by: zu1k <i@zu1k.com>
This commit is contained in:
parent
462503377c
commit
5039161a5c
@ -8,10 +8,13 @@ import (
|
|||||||
"github.com/zu1k/nali/internal/constant"
|
"github.com/zu1k/nali/internal/constant"
|
||||||
)
|
)
|
||||||
|
|
||||||
const oldDefaultWorkPath = "~/.nali/"
|
|
||||||
|
|
||||||
func migration2v6() {
|
func migration2v6() {
|
||||||
_, err := os.Stat(oldDefaultWorkPath)
|
homeDir, err := os.UserHomeDir()
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
oldDefaultWorkPath := filepath.Join(homeDir, ".nali")
|
||||||
|
_, err = os.Stat(oldDefaultWorkPath)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
println("Old data directories are detected and will attempt to migrate automatically")
|
println("Old data directories are detected and will attempt to migrate automatically")
|
||||||
oldDefaultConfigPath := filepath.Join(oldDefaultWorkPath, "config.yaml")
|
oldDefaultConfigPath := filepath.Join(oldDefaultWorkPath, "config.yaml")
|
||||||
|
Loading…
Reference in New Issue
Block a user