From e0f800201770c9f82f6f39a85c03b57f09d2beb6 Mon Sep 17 00:00:00 2001 From: heartsucker Date: Sat, 20 Oct 2018 10:14:30 +0200 Subject: [PATCH] allow passing homedir to run.sh --- run.sh | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/run.sh b/run.sh index e17882e162..1113c6995e 100755 --- a/run.sh +++ b/run.sh @@ -1,15 +1,29 @@ #!/usr/bin/env bash set -e -HOME=$(mktemp -d) +while [ -n "$1" ]; do + param="$1" + value="$2" + case $param in + --sdc-home) + SDC_HOME="$value" + shift + ;; + *) + break + esac + shift +done -echo "Running app with home directory: $HOME" +SDC_HOME=${SDC_HOME:-$(mktemp -d)} + +echo "Running app with home directory: $SDC_HOME" # create the database for local testing python - << EOF from securedrop_client.models import Base, make_engine -Base.metadata.create_all(make_engine("$HOME")) +Base.metadata.create_all(make_engine("$SDC_HOME")) EOF -exec python -m securedrop_client --home "$HOME" +exec python -m securedrop_client --sdc-home "$SDC_HOME" $@