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
@@ -12,13 +12,18 @@ import (
"syscall"
"time"
"pipelines/internal/pipeline"
"pipelines/internal/server"
"git.a-wan.net/alan/pipelines/internal/paths"
"git.a-wan.net/alan/pipelines/internal/pipeline"
"git.a-wan.net/alan/pipelines/internal/server"
)
func main() {
addr := flag.String("addr", "127.0.0.1:8080", "HTTP/WebSocket listen address")
db := flag.String("db", "pipelines.db", "SQLite database path")
defaultDB, err := paths.Database()
if err != nil {
log.Fatal(err)
}
db := flag.String("db", defaultDB, "SQLite database path (honors XDG_DATA_HOME)")
var roots []string
flag.Func("workspace-root", "Allow repository runs below this directory (repeatable; default is server working directory)", func(value string) error {
absolute, err := filepath.Abs(value)
@@ -40,6 +45,9 @@ func main() {
return nil
})
flag.Parse()
if err := os.MkdirAll(filepath.Dir(*db), 0700); err != nil {
log.Fatal(err)
}
store, err := pipeline.Open(*db)
if err != nil {
log.Fatal(err)
@@ -9,7 +9,7 @@ import (
tea "github.com/charmbracelet/bubbletea"
"pipelines/internal/tui"
"git.a-wan.net/alan/pipelines/internal/tui"
)
func main() {
+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)