Commit 054f7402 authored by Pfeiffer, Götz's avatar Pfeiffer, Götz
Browse files

repo-mirror.sh: The python3 interpreter call is now more portable.

parent 0e1790be
......@@ -84,10 +84,21 @@ function CD {
fi
}
function python_bin {
# get name of python binary
CMD "python3 --version >/dev/null 2>&1"
if [ $cmdret == 0 ]; then
echo "python3"
else
echo "python"
fi
}
function python_check_module {
# $1: module name
# $2: module name in pip
CMD "python -c 'import $1' 2>/dev/null"
_python=$(python_bin)
CMD "$_python -c 'import $1' 2>/dev/null"
if [ $cmdret -ne 0 ]; then
echo "error, you must run pip install --user $2 first"
exit 1
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment