diff --git a/script/include/helper_functions.inc.sh b/script/include/helper_functions.inc.sh index 0df1323a..9f5de990 100644 --- a/script/include/helper_functions.inc.sh +++ b/script/include/helper_functions.inc.sh @@ -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}" diff --git a/script/include/setup_functions.inc.sh b/script/include/setup_functions.inc.sh index 92c5dfa5..97ab9e4b 100644 --- a/script/include/setup_functions.inc.sh +++ b/script/include/setup_functions.inc.sh @@ -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 diff --git a/script/setup b/script/setup index 2e2dbcc6..a79c7be4 100755 --- a/script/setup +++ b/script/setup @@ -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"