-
Notifications
You must be signed in to change notification settings - Fork 0
/
.config
executable file
·48 lines (41 loc) · 1.04 KB
/
.config
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
36
37
38
39
40
41
42
43
44
45
46
47
48
# BASE
## Setting IFS (Internal Field Separator), disable considering word separated by space
IFS=$'\n\t'
## DEBUG
DEBUG=${DEBUG:-0}
if [ "${DEBUG}" -ne 0 ]; then
exec 420>${PWD}/exec.log
# Set the fd number for the output of bash trace, on newer bash only
BASH_XTRACEFD=420
set -x
fi
## STRICT MODE
# # Exit on non zero return code
# set -e keep annoying me when return status like value
# # Unknown Var
# set -u
# # if a command in a pipe failed
# set -o pipefail
# DIR
DIR_INSTALL="${HOME}/.local/lib"
DIR_BASE="${DIR_INSTALL}/lib_bash"
DIR_INC="${DIR_BASE}/inc"
DIR_SRC="${DIR_BASE}/src"
DIR_TMP="${DIR_BASE}/.tmp"
# OTHER
SCRIPT_NAME="${BASH_SOURCE[0]//.*\//}"
SCRIPT_VERSION="0.2.0"
SCRIPT_AUTHOR="Pixailz"
SCRIPT_LINK="https://github.com/Pixailz/lib_bash"
[ -d .git ] && SCRIPT_LASTUPDATED=$(git log -1 --date=format:"%x %X" --format=%cd)
## INCLUDE
### DISABLE DEBUG BEFORE INCLUDING
SOURCE_TARGET="${DIR_INC}/all"
if [ "${DEBUG}" -eq 1 ]; then
set +x
source "${SOURCE_TARGET}"
set -x
else
source "${SOURCE_TARGET}"
fi
export LIBBASH_SOURCED=1