From b7869f52056085aafac60647f1b94a20a8a951d7 Mon Sep 17 00:00:00 2001 From: "prompt.ac/@jeffrey" Date: Sun, 16 Aug 2026 11:31:25 -0400 Subject: [PATCH] =?UTF-8?q?ac-audio-room=20survives=20its=20~/.local/bin?= =?UTF-8?q?=20symlink:=20resolve=20BASH=5FSOURCE=20through=20links=20befor?= =?UTF-8?q?e=20walking=20to=20slab/macos-audio=20=E2=80=94=20the=20fleet-i?= =?UTF-8?q?nstall=20symlink=20made=20dirname=20$0=20hunt=20for=20the=20pac?= =?UTF-8?q?kage=20next=20to=20the=20symlink,=20which=20is=20why=20blueberr?= =?UTF-8?q?y's=20room-audio=20receiver=20died=20on=20arrival=20and=20Neo?= =?UTF-8?q?=20L=20=C2=B7=20Blueberry=20R=20split=20play=20never=20actually?= =?UTF-8?q?=20reached=20blueberry?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- slab/bin/ac-audio-room | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/slab/bin/ac-audio-room b/slab/bin/ac-audio-room index e4ca3aee8..0f2e69668 100755 --- a/slab/bin/ac-audio-room +++ b/slab/bin/ac-audio-room @@ -2,7 +2,16 @@ # Repository entry point for AC's shared native Mac room-audio helper. set -euo pipefail -ROOT="$(cd "$(dirname "$0")/../macos-audio" && pwd)" +# Resolve THIS script's real location before walking to the package — +# fleet installs symlink it into ~/.local/bin, and dirname "$0" would +# otherwise hunt for macos-audio next to the symlink. +SELF="${BASH_SOURCE[0]}" +while [[ -L "$SELF" ]]; do + TARGET="$(readlink "$SELF")" + [[ "$TARGET" = /* ]] || TARGET="$(dirname "$SELF")/$TARGET" + SELF="$TARGET" +done +ROOT="$(cd "$(dirname "$SELF")/../macos-audio" && pwd)" BIN="$ROOT/.build/release/ac-audio-room" if [[ ! -x "$BIN" ]]; then swift build -c release --package-path "$ROOT" -- 2.51.2