From adb5bc0a026279e9bd49571d542c76f4fc9e16f4 Mon Sep 17 00:00:00 2001 From: zongz Date: Mon, 16 Dec 2024 16:33:45 +0800 Subject: [PATCH] fix: replace all method 'os.Rename' with method 'utils.MoveOrCopy' Signed-off-by: zongz --- pkg/client/deperated.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/client/deperated.go b/pkg/client/deperated.go index 8a6d6385..9344c839 100644 --- a/pkg/client/deperated.go +++ b/pkg/client/deperated.go @@ -685,7 +685,7 @@ func (c *KpmClient) downloadPkg(options ...downloader.Option) (*pkg.KclPkg, erro } } - err = utils.MoveFile(tmpDir, localPath) + err = utils.MoveOrCopy(tmpDir, localPath) if err != nil { return nil, err } @@ -809,7 +809,7 @@ func (c *KpmClient) Download(dep *pkg.Dependency, homePath, localPath string) (* } if localPath != dep.LocalFullPath { - err = os.Rename(localPath, dep.LocalFullPath) + err = os.MoveOrCopy(localPath, dep.LocalFullPath) if err != nil { return nil, err }