-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdevelInstall
More file actions
executable file
·125 lines (103 loc) · 2.48 KB
/
develInstall
File metadata and controls
executable file
·125 lines (103 loc) · 2.48 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
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
116
117
118
119
120
121
122
123
124
125
#!/bin/sh
#
# develInstall: Installs software development infrastructure and a basic
# fallback Bash environment into my home directory.
#
# usage: develInstall [ --install | --check | --remove | --clean | --nuke ]
#
# where --install: installs dotfiles into $HOME
# --check: checks what was installed
# --remove: removes files which were installed
# --clean: same as above, deletes emptied directories
# --nuke: same as above but cleans up other content
#
# shellcheck shell=dash
#
export scriptName=develInstall
home="${DOTFILES_GIT_REPO:=~/devel/dotfiles}"/home
cd "$home" 2>/dev/null || {
printf '\n%s: Error - failed to cd into "%s"\n\n' "$scriptName" "$home"
return 1
}
. ../bin/parse_cmdline_and_source_functions.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='
git/config
'
devel_files='
venvs/ve.conf
'
remove_items="
~/.vimrc
"
dirs_to_create="
$HOME/catch
$HOME/.cabal/bin
$HOME/.local/bin
$HOME/devel/node_lts
$HOME/devel/zig_nightly
"
dirs_to_clean="
$HOME/.cabal
$HOME/.bloop
"
dirs_to_nuke="
$HOME/catch
$HOME/devel/venvs
$HOME/devel/node_lts
$HOME/devel/zig_nightly
"
## Perform ACTION
case "$DF_ACTION" in
install|check|remove)
# Process bash config files
process_files "$HOME" "$bash_files" . 0644
# Process ~/bin scripts
process_files "$HOME/bin" "$bin_scripts" bin 0755
chmod 0755 "$HOME/bin"
# Process Bloop configs for Scala
process_files "$HOME/.bloop" "$bloop_files" bloop 0644
chmod 0755 "$HOME/.bloop"
# Process Cabal configs for Haskell
process_files "$HOME/.cabal" "$cabal_files" cabal 0644
chmod 0755 "$HOME/.cabal"
# Process miscellaneous ~/.config files
process_files "$XDG_CONFIG_HOME" "$dot_config_files" config 0644
# Process devel files
process_files "$HOME/devel" "$devel_files" devel 0644
chmod 0755 "$HOME/devel"
# Remove/report no longer needed files and directories
remove_items "$remove_items"
# Create/report missing/delete directories
ensure_dirs "$dirs_to_create"
;;
clean)
remove_items "$dirs_to_clean"
;;
nuke)
remove_items "$dirs_to_clean $dirs_to_nuke"
;;
esac