Skip to content

Commit

Permalink
fix: fix windows test case
Browse files Browse the repository at this point in the history
Signed-off-by: zongz <[email protected]>
  • Loading branch information
zong-zhe committed Jun 6, 2024
1 parent 12338e0 commit 1e80f0e
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions pkg/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"io"
"os"
"path/filepath"
"runtime"
"strings"

"github.com/BurntSushi/toml"
Expand Down Expand Up @@ -1007,9 +1008,17 @@ func (c *KpmClient) Download(dep *pkg.Dependency, homePath, localPath string) (*
return nil, err
}
}
err = os.Rename(tmpDir, localPath)
if err != nil {
return nil, err

if runtime.GOOS != "windows" {
err = os.Rename(tmpDir, localPath)
if err != nil {
return nil, err
}
} else {
err = copy.Copy(tmpDir, localPath)
if err != nil {
return nil, err
}
}

// load the package from the local path.
Expand Down

0 comments on commit 1e80f0e

Please sign in to comment.