Skip to content

Commit

Permalink
fix: add module ".exe" suffix in Windows (#998)
Browse files Browse the repository at this point in the history
  • Loading branch information
SparkYuan committed Apr 1, 2024
1 parent 0500969 commit c9ad0c1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/modules/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,13 @@ func buildPluginPath(namespace, resourceType, version string) (string, error) {
goArch := runtime.GOARCH
name := resourceType + "_" + version
p := filepath.Join(prefixPath, namespace, resourceType, version, goOs, goArch, KusionModuleBinaryPrefix+name)
if runtime.GOOS == "windows" && !strings.HasSuffix(p, ".exe") {
p += ".exe"
}
_, err = os.Stat(p)
if err != nil {
if os.IsNotExist(err) {
return "", fmt.Errorf("module dir doesn't exist. %s", p)
return "", fmt.Errorf("module binary doesn't exist. %s", p)
} else {
return "", err
}
Expand Down

0 comments on commit c9ad0c1

Please sign in to comment.