Skip to content

Commit

Permalink
add ".exe" when cross compiling for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
WeidiDeng committed Apr 29, 2024
1 parent 743ce51 commit a52082c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,8 @@ func runBuild(ctx context.Context, args []string) error {

func getCaddyOutputFile() string {
f := "." + string(filepath.Separator) + "caddy"
if runtime.GOOS == "windows" {
// compiling on or for Windows, use .exe extension
if runtime.GOOS == "windows" || os.Getenv("GOOS") == "windows" {
f += ".exe"
}
return f
Expand Down

0 comments on commit a52082c

Please sign in to comment.