diff --git a/bin/genn-docker-entrypoint.sh b/bin/genn-docker-entrypoint.sh index 11db87df9d..0f3aaaf636 100755 --- a/bin/genn-docker-entrypoint.sh +++ b/bin/genn-docker-entrypoint.sh @@ -17,13 +17,15 @@ if [[ "$1" = "script" ]]; then # **YUCK** this should not really be necessary but PyGeNN does # not work nicely running scripts not in working directory CWD=$(dirname "$1") - exec gosu genn:genn /bin/bash -c "cd \"$CWD\" && python3 \"$@\"" + cd "$CWD" + exec gosu genn:genn python3 "$@" # Otherwise, if notebook is passes elif [[ "$1" = "notebook" ]]; then - # Extract working directory from next command line argument, otherwise use home + # Extract notebook directory from next command line argument, otherwise use home CWD=${2:-$HOME} exec gosu genn:genn /usr/local/bin/jupyter-notebook --ip=0.0.0.0 --port=8080 --no-browser --notebook-dir="$CWD" -# Otherwise, execute arguments +# Otherwise, change directory to home directory and execute arguments else + cd $HOME exec gosu genn:genn "$@" fi