Files
music_library/scripts/_helpers.sh
T
Claudio Ortolina c513c43a52 Ensure working directory in scripts
So that they can be run standalone and not just through Mise
2025-10-07 10:30:38 +03:00

9 lines
202 B
Bash

ensure_working_directory!() {
root_dir="$(git rev-parse --show-toplevel)"
if [[ "$PWD" != "$root_dir" ]]; then
echo "Please run the script from the root of the repo: $root_dir"
exit
fi
}