Merge pull request #1325 from dod-ccpo/setup-script-improvements

Minor improvements to script/setup
This commit is contained in:
raydds 2020-01-17 14:46:42 -05:00 committed by GitHub
commit 1647d802ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 5 deletions

View File

@ -40,9 +40,7 @@ reset_db() {
local database_name="${1}"
# If the DB exists, drop it
set +e
dropdb "${database_name}"
set -e
dropdb --if-exists "${database_name}"
# Create a fresh DB
createdb "${database_name}"

View File

@ -22,7 +22,7 @@ check_for_existing_virtual_environment() {
local target_python_version_regex="^Python ${python_version}"
# Check for existing venv, and if one exists, save the Python version string
existing_venv_version=$($(pipenv --py) --version)
existing_venv_version=$($(pipenv --py 2> /dev/null) --version 2> /dev/null)
if [ "$?" = "0" ]; then
# Existing venv; see if the Python version matches
if [[ "${existing_venv_version}" =~ ${target_python_version_regex} ]]; then

View File

@ -6,7 +6,7 @@
source "$(dirname "${0}")"/../script/include/global_header.inc.sh
# create upload directory for app
mkdir uploads | true
mkdir -p uploads
# Enable database resetting
RESET_DB="true"