prepare-commit.sh: fix script directory detection