From 8388aa615dedb22c16d07102d9179e35fa89b805 Mon Sep 17 00:00:00 2001 From: zongz <68977949+zong-zhe@users.noreply.github.com> Date: Tue, 17 Dec 2024 10:52:19 +0800 Subject: [PATCH] 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 * fix: fix typo Signed-off-by: zongz --------- 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..ae4a7467 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 = utils.MoveOrCopy(localPath, dep.LocalFullPath) if err != nil { return nil, err }