-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommon
More file actions
31 lines (24 loc) · 807 Bytes
/
common
File metadata and controls
31 lines (24 loc) · 807 Bytes
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
#!/bin/bash
# Common functionality library imported by all other scripts in this directory
# Set a flag to indicate that this script has already loaded
export INIT_READY=1
# Force all scripts to use non-interactive DPKG prompts on install
export DEBIAN_FRONTEND=noninteractive
# Import the config
source config
export INIT_HOME INIT_SRC INIT_CMD_PATH INIT_AUTO_TMUX
# Call a utility function as sourced within the current shell
function INIT {
UTIL="$1"
shift
# Special case for go-* where these scripts need including as source so we can change dir (rather than isolating them to their own Bash process)
if [[ "$UTIL" == go-* ]]; then
source "$INIT_HOME/utils/$UTIL" "$@"
else
"$INIT_HOME/utils/$UTIL" "$@"
fi
}
# Expose INIT to all sub-shells
export -f -- INIT
# Quit on any error
set -e