sapling/tests/require-ext.sh
Durham Goode 187978f40a hg: fix require-ext for core extensions
Summary:
The require-ext script tried to test the common extension module names
but failed to use the loop variable. This fixes that.

Reviewed By: quark-zju

Differential Revision: D6803708

fbshipit-source-id: 91a32bc2b63ea9ec0652342424f33c87b0898b70
2018-04-13 21:50:57 -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