mirror of
https://github.com/caddyserver/xcaddy.git
synced 2025-03-26 23:24:55 +01:00
add ".exe" when cross compiling for windows (#179)
* add ".exe" when cross compiling for windows * add ".exe" when cross compiling for windows or on windows without cross-compiling * wait until 1.23 is released
This commit is contained in:
parent
85e12f87b2
commit
bff687835e
1 changed files with 2 additions and 1 deletions
|
@ -194,7 +194,8 @@ func runBuild(ctx context.Context, args []string) error {
|
||||||
|
|
||||||
func getCaddyOutputFile() string {
|
func getCaddyOutputFile() string {
|
||||||
f := "." + string(filepath.Separator) + "caddy"
|
f := "." + string(filepath.Separator) + "caddy"
|
||||||
if runtime.GOOS == "windows" {
|
// compiling for Windows or compiling on windows without setting GOOS, use .exe extension
|
||||||
|
if os.Getenv("GOOS") == "windows" || (os.Getenv("GOOS") == "" && runtime.GOOS == "windows") {
|
||||||
f += ".exe"
|
f += ".exe"
|
||||||
}
|
}
|
||||||
return f
|
return f
|
||||||
|
|
Loading…
Add table
Reference in a new issue