mirror of
https://github.com/deadc0de6/dotdrop.git
synced 2026-02-04 15:04:43 +00:00
handle python3 as python
This commit is contained in:
11
dotdrop.sh
11
dotdrop.sh
@@ -23,15 +23,24 @@ sub="dotdrop"
|
|||||||
|
|
||||||
# pivot
|
# pivot
|
||||||
cd "${cur}" || { echo "Directory \"${cur}\" doesn't exist, aborting." && exit 1; }
|
cd "${cur}" || { echo "Directory \"${cur}\" doesn't exist, aborting." && exit 1; }
|
||||||
|
|
||||||
# init/update the submodule
|
# init/update the submodule
|
||||||
if [ "${DOTDROP_AUTOUPDATE-yes}" = yes ] ; then
|
if [ "${DOTDROP_AUTOUPDATE-yes}" = yes ] ; then
|
||||||
git submodule update --init --recursive
|
git submodule update --init --recursive
|
||||||
git submodule update --remote dotdrop
|
git submodule update --remote dotdrop
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# check python executable
|
||||||
|
pybin="python3"
|
||||||
|
hash ${pybin} 2>/dev/null || pybin="python"
|
||||||
|
[[ "`${pybin} -V 2>&1`" =~ "Python 3" ]] || { echo "install Python 3" && exit 1; }
|
||||||
|
|
||||||
# launch dotdrop
|
# launch dotdrop
|
||||||
PYTHONPATH=dotdrop python3 -m dotdrop.dotdrop "${args[@]}"
|
PYTHONPATH=dotdrop ${pybin} -m dotdrop.dotdrop "${args[@]}"
|
||||||
ret="$?"
|
ret="$?"
|
||||||
|
|
||||||
# pivot back
|
# pivot back
|
||||||
cd "${opwd}" || { echo "Directory \"${opwd}\" doesn't exist, aborting." && exit 1; }
|
cd "${opwd}" || { echo "Directory \"${opwd}\" doesn't exist, aborting." && exit 1; }
|
||||||
|
|
||||||
# exit with dotdrop exit code
|
# exit with dotdrop exit code
|
||||||
exit ${ret}
|
exit ${ret}
|
||||||
|
|||||||
Reference in New Issue
Block a user