From 969006d536d1861f9602da19d1c724f9def871f7 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 11 Apr 2026 22:26:06 +0300 Subject: Release v0.31.1: stop installing Fish ask.fish on mage install mage install no longer writes ~/.config/fish/completions/ask.fish; use ask fish | source or a conf.d snippet per docs/fish-completion.md. Made-with: Cursor --- Magefile.go | 33 --------------------------------- docs/buildandinstall.md | 3 +-- docs/fish-completion.md | 4 +--- internal/version.go | 2 +- 4 files changed, 3 insertions(+), 39 deletions(-) diff --git a/Magefile.go b/Magefile.go index 4cea341..65748fd 100644 --- a/Magefile.go +++ b/Magefile.go @@ -7,7 +7,6 @@ import ( "fmt" "io" "os" - "os/exec" "path/filepath" "regexp" "strconv" @@ -132,41 +131,9 @@ func Install() error { return err } } - return installFishCompletion(filepath.Join(bin, "ask")) -} - -func installFishCompletion(askBin string) error { - fishConfigDir, err := resolveFishConfigDir() - if err != nil { - return err - } - completionsDir := filepath.Join(fishConfigDir, "completions") - if err := os.MkdirAll(completionsDir, 0o755); err != nil { - return err - } - out, err := exec.Command(askBin, "fish").Output() - if err != nil { - return fmt.Errorf("generate fish completion: %w", err) - } - dst := filepath.Join(completionsDir, "ask.fish") - if err := os.WriteFile(dst, out, 0o644); err != nil { - return err - } - fmt.Printf("installed %s\n", dst) return nil } -func resolveFishConfigDir() (string, error) { - if xdg := os.Getenv("XDG_CONFIG_HOME"); xdg != "" { - return filepath.Join(xdg, "fish"), nil - } - home, err := os.UserHomeDir() - if err != nil { - return "", fmt.Errorf("resolve home: %w", err) - } - return filepath.Join(home, ".config", "fish"), nil -} - // RunTmuxAction runs the hexai-tmux-action TUI via go run (reads stdin). func RunTmuxAction() error { printCoverage() diff --git a/docs/buildandinstall.md b/docs/buildandinstall.md index 4a3ccd7..74562f0 100644 --- a/docs/buildandinstall.md +++ b/docs/buildandinstall.md @@ -11,8 +11,7 @@ Hexai uses Mage for developer tasks. Install Mage, then run targets like build, - In restricted sandboxes/CI (no sockets), skip network-based tests: - `HEXAI_TEST_SKIP_NET=1 go test ./... -cover` - Install binaries to `GOPATH/bin`: `mage install` -- `mage install` also writes Fish completion to `~/.config/fish/completions/ask.fish` (or `$XDG_CONFIG_HOME/fish/completions/ask.fish`) -- Load Fish completions in the current shell immediately after install: `~/go/bin/ask fish | source` +- Load Fish completions in the current shell after install: `~/go/bin/ask fish | source` (or add a `conf.d` snippet; see `docs/fish-completion.md`) Note: `mage lint` uses `golangci-lint`. Install via `mage devinstall` if needed. diff --git a/docs/fish-completion.md b/docs/fish-completion.md index f8a4373..f1e1f21 100644 --- a/docs/fish-completion.md +++ b/docs/fish-completion.md @@ -32,6 +32,4 @@ if test -x $ask_bin end ``` -No external `ask.fish` file is required. - -If you installed with `mage install`, the installer also writes an autoloadable completion file to `~/.config/fish/completions/ask.fish` (or `$XDG_CONFIG_HOME/fish/completions/ask.fish`), so new Fish sessions should pick it up automatically. +No completion file under `~/.config/fish/completions/` is required; use `ask fish | source` or the `conf.d` snippet above for new sessions. diff --git a/internal/version.go b/internal/version.go index 1e80c94..b060a26 100644 --- a/internal/version.go +++ b/internal/version.go @@ -1,4 +1,4 @@ // Package internal provides the Hexai semantic version identifier used by CLI and LSP binaries. package internal -const Version = "0.31.0" +const Version = "0.31.1" -- cgit v1.2.3