#!/usr/bin/env bash red="$(tput setaf 1)" yellow="$(tput setaf 3)" bold="$(tput bold)" reset="$(tput sgr0)" files_changed_upstream="$(mktemp)" trap "rm -f ${files_changed_upstream}" EXIT git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD >"$files_changed_upstream" grep --quiet 'requirements-dev-frozen.txt' "$files_changed_upstream" && py="install-py-dev " grep --quiet 'yarn.lock' "$files_changed_upstream" && js="install-js-dev " grep --quiet 'migrations' "$files_changed_upstream" && migrations="apply-migrations " [[ "$pc" || "$py" || "$js" || "$migrations" ]] && needs_update=1 if [[ "$needs_update" ]]; then update_command="make ${pc}${py}${js}${migrations}" if [ ! -x "${HOME}/.local/share/sentry-devenv/bin/devenv" ]; then # Old and busted. if [ ! -f ".venv/bin/activate" ]; then prompt_python_venv_creation # This is time consuming but it has to be done source "${SENTRY_ROOT}/scripts/bootstrap-py3-venv" fi else # The new hotness (coming soon). update_command="devenv sync" fi cat <