Simplify Go installation and support standard OpenCode releases

This commit is contained in:
2026-10-08 23:17:38 +01:00
parent 0f30a001c2
commit accbe63e39
101 changed files with 1331 additions and 682 deletions
+27 -3
View File
@@ -4,11 +4,12 @@ import (
"context"
"encoding/json"
"fmt"
"git.a-wan.net/alan/pipelines/internal/cli"
"git.a-wan.net/alan/pipelines/internal/installation"
"os"
"os/exec"
"os/signal"
"path/filepath"
"pipelines/internal/cli"
"pipelines/internal/installation"
"syscall"
)
@@ -31,8 +32,31 @@ func main() {
args = []string{"tui"}
}
}
if err == nil && config == nil && len(args) > 0 && args[0] == "uninstall" {
err = installation.Uninstall(executable, args[1:], os.Stdin, os.Stdout)
if err == nil {
return
}
}
if err == nil && config == nil && len(args) > 0 && args[0] == "serve" {
server, findErr := exec.LookPath("pipelines-server")
if findErr != nil {
resolved, resolveErr := filepath.EvalSymlinks(executable)
if resolveErr != nil {
err = resolveErr
} else {
server = filepath.Join(filepath.Dir(resolved), "pipelines-server")
}
}
if err == nil {
err = syscall.Exec(server, append([]string{server}, args[1:]...), os.Environ())
}
}
if err == nil && len(args) > 0 && installation.Service(args[0]) {
err = fmt.Errorf("%s requires a managed installation; run install.sh first", args[0])
err = fmt.Errorf("%s is a legacy managed-service command; use pipelines serve, or select an existing installation with PIPELINES_PREFIX", args[0])
}
if err == nil && len(args) == 0 {
args = []string{"tui"}
}
if err == nil {
err = app.Run(ctx, args)