-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhomeInstall
executable file
·115 lines (92 loc) · 2.12 KB
/
homeInstall
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#!/bin/sh
#
# homeInstall: Installs a basic Bash environment and other
# miscellaneous home directory configuration files,
#
# shellcheck shell=dash
#
scriptName=miscInstall
envName=home-env
gitRepo="${DOTFILES_GIT_REPO:=$HOME/devel/dotfiles}"
envPath="$gitRepo/$envName"
cd "$envPath" 2>/dev/null || {
printf '\n%s: Error - failed to cd into "%s"\n\n' "$scriptName" "$gitRepo"
return 1
}
# Parse cmdline arguments and source functions, if not done already
. ../bin/source_setup.sh
bash_files='
.bash_profile
.bashrc
.inputrc
'
bin_scripts='
buArch
chkcolor
codepoint
digpath
etherApe
monitor
myCalc
pathtrim
rt
spin
viewJarManifest
'
bloop_files='
bloop.json
'
cabal_files='
config
'
dot_config_files='
alacritty/alacritty.toml
git/config
'
devel_files='
venvs/ve.conf
'
remove_items="
"$HOME/.vimrc"
"$HOME/.config/alacritty/alacritty_popos.yml"
"$HOME/.config/alacritty/alacritty.yml"
"$HOME/.config/alacritty/alacritty_popos.toml"
"
dirs_to_create="
"$HOME/catch"
"$HOME/.cabal/bin"
"$HOME/.local/bin"
"
## Install, Check or Remove
# Process bash config files
process_files "$HOME" "$bash_files" . 0644 "$envPath"
# Process ~/bin scripts
process_files "$HOME/bin" "$bin_scripts" bin 0755 "$envPath"
chmod 0755 "$HOME/bin"
# Process Bloop configs for Scala
process_files "$HOME/.bloop" "$bloop_files" bloop 0644 "$envPath"
chmod 0755 "$HOME/.bloop"
# Process Cabal configs for Haskell
process_files "$HOME/.cabal" "$cabal_files" cabal 0644 "$envPath"
chmod 0755 "$HOME/.cabal"
# Process miscellaneous ~/.config files
process_files "$XDG_CONFIG_HOME" "$dot_config_files" config 0644 "$envPath"
# Process devel config files
process_files "$HOME/devel" "$devel_files" devel 0644 "$envPath"
chmod 0755 "$HOME/devel"
# Remove/report no longer needed files and directories
remove_items "$remove_items"
# Create/report missing directories
ensure_dirs "$dirs_to_create"
## Post install/check tweaks
case "$OPTION_GIVEN" in
install)
:
;;
check)
:
;;
remove)
remove_item "$XDG_CONFIG_HOME/alacritty"
;;
esac