sapling/tests/require-ext.sh
Jun Wu 2e143f9478 require-ext: fix the script
It should use `$modname` instead of `$1`.
2017-06-02 12:59:00 -07:00

16 lines
299 B
Bash
Executable File

#!/bin/bash
hasext() {
for modname in "$1" "hgext.$1" "hgext3rd.$1"; do
${PYTHON:-python} -c "import $modname" 2> /dev/null && return 0
done
false
}
for extname in "$@"; do
hasext $extname || {
echo 'skipped: missing feature: '"$extname"
exit 80
}
done