Switch remote deploy to vendored source builds
Move remote deployment to a vendored source bundle built on the target host via Docker so redeploys no longer require local cross-compilation or host Go installation. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
40
vendor/github.com/wailsapp/wails/v2/internal/shell/env.go
generated
vendored
Normal file
40
vendor/github.com/wailsapp/wails/v2/internal/shell/env.go
generated
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
package shell
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func UpsertEnv(env []string, key string, update func(v string) string) []string {
|
||||
newEnv := make([]string, len(env), len(env)+1)
|
||||
found := false
|
||||
for i := range env {
|
||||
if strings.HasPrefix(env[i], key+"=") {
|
||||
eqIndex := strings.Index(env[i], "=")
|
||||
val := env[i][eqIndex+1:]
|
||||
newEnv[i] = fmt.Sprintf("%s=%v", key, update(val))
|
||||
found = true
|
||||
continue
|
||||
}
|
||||
newEnv[i] = env[i]
|
||||
}
|
||||
if !found {
|
||||
newEnv = append(newEnv, fmt.Sprintf("%s=%v", key, update("")))
|
||||
}
|
||||
return newEnv
|
||||
}
|
||||
|
||||
func RemoveEnv(env []string, key string) []string {
|
||||
newEnv := make([]string, 0, len(env))
|
||||
for _, e := range env {
|
||||
if strings.HasPrefix(e, key+"=") {
|
||||
continue
|
||||
}
|
||||
newEnv = append(newEnv, e)
|
||||
}
|
||||
return newEnv
|
||||
}
|
||||
|
||||
func SetEnv(env []string, key string, value string) []string {
|
||||
return UpsertEnv(env, key, func(_ string) string { return value })
|
||||
}
|
||||
Reference in New Issue
Block a user