From cd04a3dade36fe1d158eb98eee1cce728ba6060a Mon Sep 17 00:00:00 2001 From: Dima Gerasimov Date: Tue, 17 Sep 2019 22:02:13 +0400 Subject: [PATCH] update example --- .gitignore | 1 + with_my.example | 18 +++++++++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 686ab24..e788c0d 100644 --- a/.gitignore +++ b/.gitignore @@ -179,3 +179,4 @@ dmypy.json .pyre/ # End of https://www.gitignore.io/api/python,emacs +with_my diff --git a/with_my.example b/with_my.example index 1fbe415..fc93f59 100755 --- a/with_my.example +++ b/with_my.example @@ -1,10 +1,18 @@ -#!/bin/bash -THISDIR="$(dirname "$0")" +#!/bin/bash -eu + +# path to my_configuration.py file +MY_CONFIGURATION_PATH= -PREV="" -if [[ -n $PYTHONPATH ]]; then +if [[ -n "${PYTHONPATH:=}" ]]; then PREV=":$PYTHONPATH" +else + PREV="" fi -export PYTHONPATH="$THISDIR$PREV" + +MY_DIR="$(dirname "$0")" +MY_CONFIGURATION_DIR="$(dirname "$MY_CONFIGURATION_PATH")" +export PYTHONPATH="$MY_CONFIGURATION_DIR:$MY_DIR""$PREV" +echo "$PYTHONPATH" + exec "$@"