fix: patch set -e out of setup.sh before running

This commit is contained in:
admin 2026-08-01 19:00:30 +00:00
parent f7689b4d6a
commit 57e0c8798a

View file

@ -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) fmt.Printf("[%s] Running setup...\n", node.Name)
// Use +e to prevent premature exit on env.list sed failure // Patch out set -e so the script doesn't exit on env.list error
cmd = exec.Command("bash", "-c", exec.Command("sed", "-i", "s/^set -e/set +e/", filepath.Join(DeployTo, "setup.sh")).Run()
fmt.Sprintf("set +e; bash %s/setup.sh --batch --token %s --cloud %s --custom-ngx-build", cmd = exec.Command("bash", filepath.Join(DeployTo, "setup.sh"),
DeployTo, apiToken, cloudFromHost(apiHost))) "--batch", "--token", apiToken, "--cloud", cloudFromHost(apiHost),
"--custom-ngx-build",
)
cmd.Dir = DeployTo cmd.Dir = DeployTo
logFile, _ := os.Create(filepath.Join(DeployTo, "install.log")) logFile, _ := os.Create(filepath.Join(DeployTo, "install.log"))