atst/script/include/run_setup
2018-07-10 14:55:26 -04:00

43 lines
1.0 KiB
Plaintext
Executable File

# setup: Set up application for the first time after cloning, or set it
# back to the initial first unused state.
# Load setup functions
source ./script/include/setup_functions.inc.sh
## Set option defaults
# If CREATE_VENV is not set, set it to "true"
if [ -z "${CREATE_VENV+is_set}" ]; then
CREATE_VENV="true"
fi
# If INSTALL_SASS is not set, set it to "false"
if [ -z "${INSTALL_SASS+is_set}" ]; then
INSTALL_SASS="false"
fi
# If PIP_VERSION is not set, set it to "10.*"
if [ -z "${PIP_VERSION+is_set}" ]; then
PIP_VERSION="10.*"
fi
## Main
# Remove any existing node modules as part of initial app setup or reset
rm -rf ./node_modules
if [ "${CREATE_VENV}" = "true" ]; then
# Ensure pipenv is installed
if ! check_system_pip_for pipenv; then
echo "ERROR: pipenv is required but is not present"
exit 1
fi
create_virtual_environment
pip_install "pip==${PIP_VERSION}" "--upgrade"
fi
if [ "${INSTALL_SASS}" = "true" ]; then
install_sass
fi
# Install application dependencies
./script/bootstrap