fix(vendor): find the repository root from the script's location

`git rev-parse --show-toplevel` names the outermost repository, so with atuin
checked out as a subdirectory of another one, `list` and `update` looked for
vendor/.repositories.json in the wrong place.
This commit is contained in:
Marko Vejnovic
2026-10-01 22:07:53 -07:00
parent ee9ebe889e
commit 283881ed4e
+3 -1
View File
@@ -5,7 +5,9 @@
# shellcheck disable=SC2016 # `$n` is a jq variable
set -euf
root_dir=$(command git rev-parse --show-toplevel)
# Not `git rev-parse --show-toplevel`: when this repository is a subdirectory of
# another one, that's the outer repository's root.
root_dir=$(cd -- "$(dirname -- "$0")/.." && pwd)
vendor_dir=vendor
db_path=$vendor_dir/.repositories.json
script_name=$(basename "$0")