From 4aad6a6ba69e93f1c9871de47c142f2b70d6f576 Mon Sep 17 00:00:00 2001 From: Pyronewbic Date: Sun, 31 May 2026 17:12:58 +0530 Subject: [PATCH] fix(version): report sluice's own version, not an enclosing repo's; v0.1.1 + brew `git describe` at the install dir walked up to an enclosing git repo (e.g. Homebrew's /opt/homebrew), so a brew-installed `sluice -v` reported Homebrew's version. Only trust git when $ROOT is sluice's own checkout (.git present), else the baked SLUICE_VERSION. Also bump the baked version to 0.1.1, add `brew install Pyronewbic/tap/sluice` to the README (the tap is now live), and mark the in-repo formula a template (the tap is the source of truth). --- README.md | 8 ++++---- bin/sluice | 6 +++--- packaging/homebrew/sluice.rb | 5 +++-- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 6bda25f..1afddad 100644 --- a/README.md +++ b/README.md @@ -12,13 +12,13 @@ to run - sluice builds the image and runs it. ## Install ```bash -curl -fsSL https://raw.githubusercontent.com/Pyronewbic/Sluice/main/install.sh | sh +brew install Pyronewbic/tap/sluice +# or: curl -fsSL https://raw.githubusercontent.com/Pyronewbic/Sluice/main/install.sh | sh # or, from a checkout: ./install.sh ``` -Symlinks `bin/sluice` into `~/.local/bin` (ensure it's on `PATH`). Needs **docker** or -**podman** to build and run (`sluice init` needs neither). (A Homebrew tap is coming - see -[`packaging/`](packaging/).) +The installer symlinks `bin/sluice` into `~/.local/bin` (ensure it's on `PATH`). Needs +**docker** or **podman** to build and run (`sluice init` needs neither). ## Use diff --git a/bin/sluice b/bin/sluice index 8644a01..6ed85d2 100755 --- a/bin/sluice +++ b/bin/sluice @@ -30,10 +30,10 @@ CORE="$ROOT/core" die() { echo "[sluice] $*" >&2; exit 1; } # --- version + help ------------------------------------------------------------ -SLUICE_VERSION="0.1.0" # fallback when not a git checkout -sluice_version() { # git tag if available, else the baked constant +SLUICE_VERSION="0.1.1" # fallback when not a git checkout +sluice_version() { # git tag if $ROOT is our own checkout, else the baked constant local v - if v="$(git -C "$ROOT" describe --tags --always --dirty 2>/dev/null)" && [ -n "$v" ]; then + if [ -e "$ROOT/.git" ] && v="$(git -C "$ROOT" describe --tags --always --dirty 2>/dev/null)" && [ -n "$v" ]; then printf '%s' "${v#v}" else printf '%s' "$SLUICE_VERSION" diff --git a/packaging/homebrew/sluice.rb b/packaging/homebrew/sluice.rb index 861cc60..1e02ab1 100644 --- a/packaging/homebrew/sluice.rb +++ b/packaging/homebrew/sluice.rb @@ -7,8 +7,9 @@ class Sluice < Formula desc "Sandboxed, egress-firewalled container runner for projects and coding agents" homepage "https://github.com/Pyronewbic/Sluice" - url "https://github.com/Pyronewbic/Sluice/archive/refs/tags/v0.1.0.tar.gz" - sha256 "0000000000000000000000000000000000000000000000000000000000000000" # TODO: fill at release + # Template; the live, sha-pinned formula is in the tap (github.com/Pyronewbic/homebrew-tap). + url "https://github.com/Pyronewbic/Sluice/archive/refs/tags/v0.1.1.tar.gz" + sha256 "0000000000000000000000000000000000000000000000000000000000000000" # set in the tap at release license "Apache-2.0" # Runtime needs docker or podman, which Homebrew shouldn't manage - documented, not a dep.