File: debug-console-wrapper.sh

package info (click to toggle)
passenger 6.1.1%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 50,788 kB
  • sloc: cpp: 589,292; ruby: 43,761; ansic: 27,742; javascript: 5,948; python: 1,158; sh: 1,012; makefile: 51
file content (29 lines) | stat: -rwxr-xr-x 732 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/env bash
set -eo pipefail

SELFDIR=$(dirname "$0")
SELFDIR=$(cd "$SELFDIR" && pwd)
PASSENGER_ROOT=$(cd "$SELFDIR/../../.." && pwd)
# shellcheck source=../lib/functions.sh
source "$SELFDIR/../lib/functions.sh"

if ! "$@"; then
	echo
	echo "-----------------------------"
	echo
	echo "*** An error occurred ***"

	if [[ "$DEBUG_CONSOLE" == 1 ]]; then
		echo
		echo "*** DEBUG_CONSOLE set to 1, so launching a debugging console..."
		echo
		set +e
		# shellcheck source=../lib/set-container-envvars.sh
		source "$PASSENGER_ROOT/dev/ci/lib/set-container-envvars.sh"
		header2 "Launching bash"
		bash -l
	else
		echo "If you want to debug this, run '$CI_COMMAND' with the environment variable DEBUG_CONSOLE=1."
	fi
	exit 1
fi