summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormjk <mjk@disroot.org>2022-07-24 19:15:26 +0000
committerEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2022-08-02 21:31:56 +0200
commit940f5e0c8a695048e6b7dfd3dd13e49e0c3476a5 (patch)
tree71c4c65037860f0449439ab6347871cd96351ce7
parentbb2e72663aaebec5a245ae900d83d9a3a46baddc (diff)
downloadpoezio-940f5e0c8a695048e6b7dfd3dd13e49e0c3476a5.tar.gz
poezio-940f5e0c8a695048e6b7dfd3dd13e49e0c3476a5.tar.bz2
poezio-940f5e0c8a695048e6b7dfd3dd13e49e0c3476a5.tar.xz
poezio-940f5e0c8a695048e6b7dfd3dd13e49e0c3476a5.zip
launch.sh: don't change current working directory
-rwxr-xr-xlaunch.sh12
1 files changed, 6 insertions, 6 deletions
diff --git a/launch.sh b/launch.sh
index 94283109..b9d59cb5 100755
--- a/launch.sh
+++ b/launch.sh
@@ -1,20 +1,20 @@
#!/bin/sh
-cd $(dirname "$(readlink -f "$0")")
+proj_dir=$(dirname "$(readlink -f "$0")")
if [ -z "$POEZIO_VENV" ]
then
POEZIO_VENV="poezio-venv"
fi
-if [ -e .git ]
+if [ -e "$proj_dir/.git" ]
then
- args=$(git show --format='%h %ci' | head -n1)
+ args=$(git -C "$proj_dir" show --format='%h %ci' | head -n1)
else
args="0.14-dev"
fi
-if [ -e "$POEZIO_VENV" ]
+if [ -e "$proj_dir/$POEZIO_VENV" ]
then
- PYTHON3="$POEZIO_VENV/bin/python3"
+ PYTHON3="$proj_dir/$POEZIO_VENV/bin/python3"
else
echo ""
echo "WARNING: Not using the up-to-date launch format"
@@ -25,5 +25,5 @@ else
fi
$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
-exec "$PYTHON3" -m poezio --custom-version "$args" "$@"
+PYTHONPATH="$proj_dir:$PYTHONPATH" exec "$PYTHON3" -m poezio --custom-version "$args" "$@"