Skip to content

Commit 8388aa6

Browse files
authored
fix: replace all method 'os.Rename' with method 'utils.MoveOrCopy' (#567)
* fix: replace all method 'os.Rename' with method 'utils.MoveOrCopy' Signed-off-by: zongz <zongzhe1024@163.com> * fix: fix typo Signed-off-by: zongz <zongzhe1024@163.com> --------- Signed-off-by: zongz <zongzhe1024@163.com>
1 parent c168a63 commit 8388aa6

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 = utils.MoveOrCopy(localPath, dep.LocalFullPath)
813813
if err != nil {
814814
return nil, err
815815
}

0 commit comments

Comments
 (0)