diff options
Diffstat (limited to 'bcnc-git')
-rwxr-xr-x | bcnc-git | 21 |
1 files changed, 14 insertions, 7 deletions
@@ -1,9 +1,16 @@ #!/usr/bin/env sh -DIR=/opt/bcnc-git -PYTHONPATH=${DIR}:${DIR}/lib:${DIR}/plugins -export DIR PYTHONPATH -if [ .$PYTHON = . ]; then - PYTHON=python2 -fi -${PYTHON} ${DIR}/bCNC.py $* +#Autodetect python version +[ .$PYTHON = . ] && PYTHON=`which python2` +[ .$PYTHON = . ] && PYTHON=python + +#Autodetect bCNC install +#If this script is placed in directory with bCNC module it will launch it +#When placed somewhere else (eg. /usr/bin) it will launch bCNC from system +DIR=`dirname $0` +[ -f "${DIR}"/bCNC-git/__main__.py ] && cd "${DIR}" && + echo "Launching bCNC from ${DIR}" || + echo "Launching local installation of bCNC" + +#Launch +"$PYTHON" -m bCNC-git $* |