mirror of https://github.com/citusdata/citus.git
Add some comments
parent
df395cdbd0
commit
bd6268fea3
|
@ -20,13 +20,18 @@ echo_and_restore() {
|
||||||
# Make sure that on a failing exit we show a useful message
|
# Make sure that on a failing exit we show a useful message
|
||||||
hint_on_fail() {
|
hint_on_fail() {
|
||||||
exit_code=$?
|
exit_code=$?
|
||||||
|
if [ $exit_code == 0 ]; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
# Get filename of the currently running script
|
# Get filename of the currently running script
|
||||||
# Source: https://stackoverflow.com/a/192337/2570866
|
# Source: https://stackoverflow.com/a/192337/2570866
|
||||||
filename=$(basename "$0" | sed 's/\.sh$/sh/g')
|
filename=$(basename "$0")
|
||||||
directory=$(dirname "$0")
|
directory=$(dirname "$0")
|
||||||
if [ $exit_code != 0 ]; then
|
# Replace .sh at the end of the filename with "sh", because github strips
|
||||||
echo "HINT: To solve this failure look here: https://github.com/citusdata/citus/blob/master/$directory/README.md#$filename"
|
# dots from the title when it generates the anchors.
|
||||||
fi
|
anchor="${filename//.sh/sh}"
|
||||||
|
echo "HINT: To solve this failure look here: https://github.com/citusdata/citus/blob/master/$directory/README.md#$anchor"
|
||||||
exit $exit_code
|
exit $exit_code
|
||||||
}
|
}
|
||||||
trap hint_on_fail EXIT
|
trap hint_on_fail EXIT
|
||||||
|
|
Loading…
Reference in New Issue