-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·67 lines (57 loc) · 1.22 KB
/
setup.sh
File metadata and controls
executable file
·67 lines (57 loc) · 1.22 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
#!/bin/bash
dummy="false"
function log_success {
printf "\033[0;32m$1\033[0m\n"
}
function log_fail {
printf "\033[0;31m$1\033[0m\n"
}
function helper_ask_yn {
local ref=$2
if ${!2} -eq "true"; then return 0; fi
while true; do
read -p "> $1 [Yes/Any/No] " yn
case $yn in
"" ) return 0;;
[Yy]* ) return 0;;
[Nn]* ) return 1;;
Any ) eval $ref="true" && return 0;;
* ) echo "Please answer yes or no.";;
esac
done
}
echo "Configuring neovim ✏️"
helper_ask_yn "Do you want to configure neovim in $HOME/.config/nvim ?" "dummy"
if test $? -eq 0; then
log_success "Linking $PWD/home/.config/nvim -> $HOME/.config/nvim"
# ln -sf "$PWD/home/.config/nvim" "$HOME/.config/nvim"
fi
echo "Installing packages 📦"
ports=$(cat <<EOL
bash
bash-completion
coreutils
fd
findutils
fzf
gawk
git
grep
gsed
wget
htop
jq
inetutils
watch
EOL
)
any_macports="false"
for p in $ports; do
helper_ask_yn "Do you want to install $p ?" "any_macports"
if test $? -eq 0; then
log_success "Installing $p"
brew install $p
else
log_fail "Skipping $p"
fi
done