From 57e0c8798ad70914eeb9ebfec40af5616b6377e0 Mon Sep 17 00:00:00 2001 From: admin Date: Sat, 1 Aug 2026 19:00:30 +0000 Subject: [PATCH] fix: patch set -e out of setup.sh before running --- internal/native/native.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/internal/native/native.go b/internal/native/native.go index 305e307..00cfa12 100644 --- a/internal/native/native.go +++ b/internal/native/native.go @@ -78,12 +78,14 @@ func InstallNode(node state.Node, apiToken, apiHost, labels string) error { } }() - // 6. Run setup.sh (ignore env.list error, check for real success) + // 6. Run setup.sh (remove set -e to survive env.list deletion) fmt.Printf("[%s] Running setup...\n", node.Name) - // Use +e to prevent premature exit on env.list sed failure - cmd = exec.Command("bash", "-c", - fmt.Sprintf("set +e; bash %s/setup.sh --batch --token %s --cloud %s --custom-ngx-build", - DeployTo, apiToken, cloudFromHost(apiHost))) + // Patch out set -e so the script doesn't exit on env.list error + exec.Command("sed", "-i", "s/^set -e/set +e/", filepath.Join(DeployTo, "setup.sh")).Run() + cmd = exec.Command("bash", filepath.Join(DeployTo, "setup.sh"), + "--batch", "--token", apiToken, "--cloud", cloudFromHost(apiHost), + "--custom-ngx-build", + ) cmd.Dir = DeployTo logFile, _ := os.Create(filepath.Join(DeployTo, "install.log"))