launch.sh 708 Bytes
Newer Older
louiz’'s avatar
louiz’ committed
1
#!/bin/sh
2
cd $(dirname "$(readlink -f "$0")")
3 4 5 6
if [ -z "$POEZIO_VENV" ]
then
    POEZIO_VENV="poezio-venv"
fi
7

8
if [ -e .git ]
mathieui's avatar
mathieui committed
9
then
10
    args=$(git show --format='%h %ci' | head -n1)
mathieui's avatar
mathieui committed
11
else
mathieui's avatar
mathieui committed
12
    args="0.13.1-dev"
mathieui's avatar
mathieui committed
13
fi
14

15
if [ -e "$POEZIO_VENV" ]
16
then
17
    PYTHON3="$POEZIO_VENV/bin/python3"
18 19 20 21 22 23 24 25 26
else
    echo ""
    echo "WARNING: Not using the up-to-date launch format"
    echo "Run ./update.sh again to create a virtualenv with the deps"
    echo "(or ignore this message if you don't want to)"
    echo ""
    PYTHON3=python3
fi

27
$PYTHON3 -c 'import sys;(print("Python 3.7 or newer is required") and exit(1)) if sys.version_info < (3, 7) else exit(0)' || exit 1
28
exec "$PYTHON3" -m poezio --custom-version "$args" "$@"
louiz’'s avatar
louiz’ committed
29