Skip to content

Commit

Permalink
fix: replace all method 'os.Rename' with method 'utils.MoveOrCopy' (#567
Browse files Browse the repository at this point in the history
)

* fix: replace all method 'os.Rename' with method 'utils.MoveOrCopy'

Signed-off-by: zongz <[email protected]>

* fix: fix typo

Signed-off-by: zongz <[email protected]>

---------

Signed-off-by: zongz <[email protected]>
  • Loading branch information
zong-zhe authored Dec 17, 2024
1 parent c168a63 commit 8388aa6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/client/deperated.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit 8388aa6

Please sign in to comment.