When gsd-from-source is invoked via a symlink (e.g. ~/.bun/bin/gsd-real
pointing at it so `gsd` resolves to source without further indirection),
BASH_SOURCE[0] is the symlink path, not the real file. The previous
dirname-of-BASH_SOURCE[0] approach resolved SCRIPT_DIR to the symlink's
parent dir (e.g. ~/.bun/bin) and tried to bun-run ~/.bun/src/loader.ts,
which doesn't exist.
Wrapping BASH_SOURCE[0] in readlink -f resolves the physical path first,
so SCRIPT_DIR always points at bin/ inside the gsd source checkout
regardless of how the script is reached.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>