local_install.sh 638 Bytes
Newer Older
1
2
3
#!/bin/sh
set -e

4
5
6
7
8
9
VER=2
if [ "$1" = -3 ]; then
    VER=3
    shift
fi

10
11
if [ -z "${PYTHON}" ]; then
    which python >/dev/null 2>&1 && PYTHON=$(which python)
12
13
14
15
16
    which python$VER >/dev/null 2>&1 && PYTHON=$(which python$VER)
    if [ $VER -eq 2 ]; then
        which python2.7 >/dev/null 2>&1 && PYTHON=$(which python2.7)
    else
        which python3.4 >/dev/null 2>&1 && PYTHON=$(which python3.4)
17
18
        which python3.5 >/dev/null 2>&1 && PYTHON=$(which python3.5)
        which python3.6 >/dev/null 2>&1 && PYTHON=$(which python3.6)
19
    fi
20
21
fi

22
$PYTHON "$(dirname $0)/stale_pyc.py"
23

24
exec $PYTHON "$(dirname $0)/local_install.py" "$@"