forked from airbytehq/airbyte
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshell_defaults
35 lines (28 loc) · 1.13 KB
/
shell_defaults
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
30
31
32
33
34
35
# do you want pretty and verbose output?
# copy the snippet below or relative pathing in shell from your file
# ---------SNIPPET-------------------
# # Source shell defaults
# # $0 is the currently running program (this file)
# this_file_directory=$(dirname $0)
# EDIT THIS ONE LINE IN YOUR SCRIPT
# relative_path=$this_file_directory/../your_path_here
# # if a file exists there, source it. otherwise complain
# if test -f $relative_path; then
# source $relative_path
# else
# echo -e "\033[31m\nFAILED TO SOURCE TEST RUNNING OPTIONS.\033[39m"
# echo -e "\033[31mTried $relative_path\033[39m"
# exit 1
# fi
# ----------------------------
# Run away from anything even a little scary
set -o nounset # -u exit if a variable is not set
set -o errexit # -f exit for any command failure
# text color escape codes (please note \033 == \e but OSX doesn't respect the \e)
blue_text='\033[94m'
red_text='\033[31m'
default_text='\033[39m'
# set -x/xtrace' uses a Sony PS4 for more info
PS4="$blue_text"'${BASH_SOURCE}:${LINENO}:'"$default_text "
# Last for more pretty output
set -o xtrace # -x display every line before exectution; enables PS4