mirror of
https://github.com/atuinsh/atuin.git
synced 2026-10-11 22:29:51 +00:00
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:
Vendored
+3
-1
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user