-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig
More file actions
executable file
·57 lines (47 loc) · 1.27 KB
/
config
File metadata and controls
executable file
·57 lines (47 loc) · 1.27 KB
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
49
50
51
52
53
54
55
56
57
#!/bin/bash
[[ "$0" == */config ]] && cd -P -- "$(dirname "$0")"
export CONFIG_DIR="$PWD/.setup/main"
source ./helpers/config
if [[ ! -z ${1+x} && "$1" == "clear" ]] ; then
if [[ ! -z ${2+x} && "$2" == "all" ]] ; then
echo "Clearing all global configs..."
clear_config
echo
./dotfiles/config clear
./secure/config clear
elif [ ! -z ${2+x} ] ; then
echo "Clearing global config \"$2\"..."
clear_config "$2"
echo
else
echo "Clearing all global configs..."
clear_config
echo
fi
fi
profiles=$(find -L profiles -maxdepth 1 -type d ! -name 'template' ! -name '.setup' -printf '%P ')
DOTFILE_PROFILE=""
while [ ! -z ${DOTFILE_PROFILE+x} ] ; do
DOTFILE_PROFILE=$(read_config \
dotfile_profile \
"your active dotfile profile [$profiles]")
if [[ " ${profiles} " =~ " ${DOTFILE_PROFILE} " ]]; then
update_config dotfile_profile "$DOTFILE_PROFILE" true
break;
else
echo "Invalid Profile \"$DOTFILE_PROFILE\" [$profiles]!"
fi
done
echo "Using Config:"
echo " dotfile profile: $DOTFILE_PROFILE"
echo
# Load subconfigs of specified
if [[ ! -z ${1+x} && "$1" == "all" ]] ; then
echo "Updating dotfile config"
./dotfiles/config
echo
echo "Updating secure config"
echo
./secure/config
fi
export DOTFILE_PROFILE