Skip to content

Commit

Permalink
Calculate basedir once
Browse files Browse the repository at this point in the history
  • Loading branch information
dmotte committed Dec 18, 2024
1 parent e0844bd commit 9742484
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions scripts/mottekit/mottekit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ readonly subcmd=$1; shift

[ "$subcmd" = help ] || [ "$subcmd" = version ] && { mottekit_info; exit; }

basedir=$(dirname "$0")

for i in ~/.mottekit/overrides/"$subcmd.sh" \
"$(dirname "$0")/$subcmd.sh" \
"$(dirname "$(dirname "$0")")/$subcmd.sh"
"$basedir/$subcmd.sh" \
"$(dirname "$basedir")/$subcmd.sh"

do [ -e "$i" ] && exec bash "$i" "$@"
done
Expand Down

0 comments on commit 9742484

Please sign in to comment.