-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharcher
More file actions
executable file
·55 lines (42 loc) · 1.11 KB
/
Copy patharcher
File metadata and controls
executable file
·55 lines (42 loc) · 1.11 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
#!/usr/bin/env bash
# functions
source archlinux/shell
# arch installer
source archlinux/base
source archlinux/system
# display help when no arguments passed
[[ $# -eq 0 ]] && archerHelp
# default values
section="base"
config_path="config/xfce-config/xfce-config"
option_debug=false
# parse arguments
while [[ $# -gt 0 ]]; do
case $1 in
# install archlinux
-b | --base) section="base" ;;
-s | --system) section="system" ;;
-c | --config)
shift
path="$1"
grep -qi false <<< $(isFileExist "$path") && {
message "$yellow$path ${important}config file does not exist{norm}!\n"
exit
}
config_path="$path"
;;
# other options
-d | --debug) option_debug=true ;;
-h | --help) archerHelp ;;
*) archerHelp "$1" ;;
esac
shift # next argument
done
# parse config file
source archlinux/parser "$config_path"
# set debug option
grep -q true <<< "$option_debug" && {
options[debug]=true
}
# execute section function
eval "$section"