Ensure working directory in scripts

So that they can be run standalone and not just through Mise
This commit is contained in:
Claudio Ortolina
2025-10-07 10:30:38 +03:00
parent 9ab687e306
commit c513c43a52
11 changed files with 48 additions and 0 deletions
+8
View File
@@ -0,0 +1,8 @@
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
}