diff options
author | pspiridonov | 2018-11-20 10:51:27 +0300 |
---|---|---|
committer | pspiridonov | 2018-11-20 10:51:27 +0300 |
commit | 516a083e9e070eef6627ee1aa7d44a458f7ddb0a (patch) | |
tree | 3ddf4a970df4b9370fec9f77476db23ea9358b2a /bcnc-git | |
parent | 84e9f6ce7a1cf0d848c199f30f1188669bd85b4d (diff) | |
download | aur-bcnc-git.tar.gz |
move app from opt to python2 modules
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 $* |