Skip to content

Commit

Permalink
fix: replace all method 'os.Rename' with method 'utils.MoveOrCopy'
Browse files Browse the repository at this point in the history
Signed-off-by: zongz <[email protected]>
  • Loading branch information
zong-zhe committed Dec 16, 2024
1 parent b8452c5 commit adb5bc0
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 = os.MoveOrCopy(localPath, dep.LocalFullPath)

Check failure on line 812 in pkg/client/deperated.go

View workflow job for this annotation

GitHub Actions / e2e test

undefined: os.MoveOrCopy

Check failure on line 812 in pkg/client/deperated.go

View workflow job for this annotation

GitHub Actions / Unit tests on Windows

undefined: os.MoveOrCopy

Check failure on line 812 in pkg/client/deperated.go

View workflow job for this annotation

GitHub Actions / Unit tests with coverage

undefined: os.MoveOrCopy
if err != nil {
return nil, err
}
Expand Down

0 comments on commit adb5bc0

Please sign in to comment.