From c2430c2dca684d792d2799e25d23185a90ade72c Mon Sep 17 00:00:00 2001 From: Tom Mulcahy Date: Wed, 25 Feb 2026 17:13:11 -0800 Subject: [PATCH] Resolve radiography symlink --- stoic-plugin/prebuilt/radiography | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/stoic-plugin/prebuilt/radiography b/stoic-plugin/prebuilt/radiography index 3b8d2f9..166f083 100755 --- a/stoic-plugin/prebuilt/radiography +++ b/stoic-plugin/prebuilt/radiography @@ -6,7 +6,16 @@ set -e -SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +# Homebrew invokes this via a symlink in /opt/homebrew/bin, so resolve the +# real script path before locating the bundled plugin APK next to this script. +SOURCE="${BASH_SOURCE[0]}" +while [ -L "$SOURCE" ]; do + SOURCE_DIR="$(cd -P "$(dirname "$SOURCE")" && pwd)" + SOURCE="$(readlink "$SOURCE")" + [[ "$SOURCE" != /* ]] && SOURCE="${SOURCE_DIR}/${SOURCE}" +done + +SCRIPT_DIR="$(cd -P "$(dirname "$SOURCE")" && pwd)" PLUGIN_APK="${SCRIPT_DIR}/stoic-plugin-debug.apk" # Check if stoic is installed