File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,15 +3,16 @@ package assets
33import (
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}
You can’t perform that action at this time.
0 commit comments