sapling/tests/require-ext.sh

16 lines
299 B
Bash
Raw Normal View History

#!/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