Skip to content

Commit adb5bc0

Browse files
committed
fix: replace all method 'os.Rename' with method 'utils.MoveOrCopy'
Signed-off-by: zongz <zongzhe1024@163.com>
1 parent b8452c5 commit adb5bc0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/client/deperated.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -685,7 +685,7 @@ func (c *KpmClient) downloadPkg(options ...downloader.Option) (*pkg.KclPkg, erro
685685
}
686686
}
687687

688-
err = utils.MoveFile(tmpDir, localPath)
688+
err = utils.MoveOrCopy(tmpDir, localPath)
689689
if err != nil {
690690
return nil, err
691691
}
@@ -809,7 +809,7 @@ func (c *KpmClient) Download(dep *pkg.Dependency, homePath, localPath string) (*
809809
}
810810

811811
if localPath != dep.LocalFullPath {
812-
err = os.Rename(localPath, dep.LocalFullPath)
812+
err = os.MoveOrCopy(localPath, dep.LocalFullPath)
813813
if err != nil {
814814
return nil, err
815815
}

0 commit comments

Comments
 (0)