2023-11-30 02:59:17 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
function error_handler() {
|
|
|
|
>&2 echo "Exited with BAD EXIT CODE '${2}' in ${0} script at line: ${1}."
|
|
|
|
exit "$2"
|
|
|
|
}
|
|
|
|
trap 'error_handler ${LINENO} $?' ERR
|
|
|
|
set -o errtrace -o errexit -o nounset -o pipefail
|
|
|
|
|
|
|
|
if ! command -v pydeps >/dev/null 2>&1; then
|
|
|
|
echo "pydeps is not installed. installing..."
|
|
|
|
pip install pydeps
|
|
|
|
fi
|
|
|
|
|
2023-12-05 16:41:59 +00:00
|
|
|
pydeps_args=()
|
|
|
|
|
2023-11-30 03:15:52 +00:00
|
|
|
if [[ "${1:-}" == "r" ]]; then
|
2023-12-05 16:41:59 +00:00
|
|
|
shift
|
|
|
|
pydeps_args+=("--rankdir" "LR")
|
|
|
|
fi
|
|
|
|
|
|
|
|
# add other args to only
|
|
|
|
# example usage:
|
|
|
|
# ./bin/run_pydeps spiffworkflow_backend.services.process_instance_processor spiffworkflow_backend.services.process_instance_service spiffworkflow_backend.background_processing spiffworkflow_backend.routes.tasks_controller spiffworkflow_backend.services.workflow_execution_service
|
|
|
|
if [[ -n "${1:-}" ]]; then
|
|
|
|
pydeps_args+=("--only")
|
|
|
|
for arg in "$@"; do
|
|
|
|
pydeps_args+=("$arg")
|
|
|
|
done
|
2023-11-30 03:15:52 +00:00
|
|
|
fi
|
|
|
|
|
2023-12-05 16:41:59 +00:00
|
|
|
if [[ -f "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" ]]; then
|
|
|
|
pydeps_args+=("--display" "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome")
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
# the only at the end is specific to this branch
|
|
|
|
pydeps src/spiffworkflow_backend --only spiffworkflow_backend --rmprefix spiffworkflow_backend. --exclude-exact spiffworkflow_backend.background_processing spiffworkflow_backend.services.custom_parser spiffworkflow_backend.specs spiffworkflow_backend.services spiffworkflow_backend spiffworkflow_backend.models spiffworkflow_backend.load_database_models spiffworkflow_backend.routes --exclude spiffworkflow_backend.config spiffworkflow_backend.interfaces spiffworkflow_backend.models.db "${pydeps_args[@]}"
|