Skip to content

Commit 6a81f6c

Browse files
committed
fix: MvConfig
1 parent d8b78fd commit 6a81f6c

1 file changed

Lines changed: 11 additions & 6 deletions

File tree

client/assets/asset.go

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,16 @@ package assets
33
import (
44
_ "embed"
55
"fmt"
6-
"github.com/chainreactors/IoM-go/client"
7-
"github.com/chainreactors/IoM-go/mtls"
8-
"github.com/chainreactors/logs"
9-
"github.com/chainreactors/malice-network/helper/utils/fileutils"
106
"os"
117
"os/user"
128
"path/filepath"
139
"strings"
1410
"time"
11+
12+
"github.com/chainreactors/IoM-go/client"
13+
"github.com/chainreactors/IoM-go/mtls"
14+
"github.com/chainreactors/logs"
15+
"github.com/chainreactors/malice-network/helper/utils/fileutils"
1516
)
1617

1718
//go:embed audit.html
@@ -175,6 +176,10 @@ func MvConfig(oldPath string) error {
175176
}
176177
}
177178

178-
// Use MoveFile which handles overwriting automatically via os.Create
179-
return fileutils.MoveFile(oldPath, newPath)
179+
err = fileutils.CopyFile(oldPath, newPath)
180+
if err != nil {
181+
logs.Log.Warnf("failed to copy config file %s: %s", newPath, err.Error())
182+
return err
183+
}
184+
return nil
180185
}

0 commit comments

Comments
 (0)