Skip to content

Commit

Permalink
allow passing homedir to run.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
heartsucker committed Oct 20, 2018
1 parent 39bb4b7 commit e0f8002
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions run.sh
Original file line number Diff line number Diff line change
@@ -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" $@

0 comments on commit e0f8002

Please sign in to comment.