avoid cd if running from the same directory

see #8
This commit is contained in:
Ren Tatsumoto 2021-12-31 16:47:40 +03:00
parent 4d0e588147
commit b4deae5b57

View file

@ -1,9 +1,11 @@
#!/bin/sh -e
readonly this=$(readlink -f -- "$0")
readonly dir=$(dirname -- "$this")
readonly module=antp
cd -- "$dir" || exit
if ! [ -d "$module" ]; then
readonly this=$(readlink -f -- "$0")
readonly dir=$(dirname -- "$this")
cd -- "$dir" || exit 1
fi
python3 -m "$module" "$@"