From 438210223f900f2d8b9984647f66de401166471a Mon Sep 17 00:00:00 2001 From: Dima Gerasimov Date: Tue, 17 Sep 2019 22:58:50 +0400 Subject: [PATCH] use readlink --- with_my.example | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/with_my.example b/with_my.example index fc93f59..f3d3900 100755 --- a/with_my.example +++ b/with_my.example @@ -1,6 +1,6 @@ #!/bin/bash -eu -# path to my_configuration.py file +# set path to my_configuration.py file here MY_CONFIGURATION_PATH= @@ -10,9 +10,8 @@ else PREV="" fi -MY_DIR="$(dirname "$0")" -MY_CONFIGURATION_DIR="$(dirname "$MY_CONFIGURATION_PATH")" +MY_DIR="$(dirname "$(readlink -f "$0")")" +MY_CONFIGURATION_DIR="$(dirname "$(readlink -f "$MY_CONFIGURATION_PATH")")" export PYTHONPATH="$MY_CONFIGURATION_DIR:$MY_DIR""$PREV" -echo "$PYTHONPATH" exec "$@"