-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·119 lines (115 loc) · 4.29 KB
/
install.sh
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
#!/usr/bin/env bash
# Check Requirements
requirements_list=("zsh" "git" "curl" "rsync" "omz")
for i in "${requirements_list[@]}"; do
if ! [ "$(command -v "$i")" ]; then
echo "$i not installed. Install it and then run the script."
exit 1
fi
done
# Create installation files/directories
echo "#!/usr/bin/env bash" > dotfiles.sh
echo "source sync-functions.sh" >> dotfiles.sh
mkdir "$HOME"/.dotfiles_backups "$HOME"/terminal-utilities
# Menu
printf "Hello! This is the KDotfiles Dotfile Selection Menu:\n"
while true; do
printf "Choose Dotfiles to Install/Sync:\n"
printf " ,1. gnupg,2. zsh,3. git,4. vim,5. bin\n,6. npmrc,7. amfora,8. bat,9. lazygit,10. lsd\n,11. poetry,12. ngrok,13. starship, 14. topgrade, 15. All" | column --table -s ","
read -rp "Choose dotfiles [1-15/q](comma-separated): " CHOOSE
IFS="," read -ra CHOOSE_ARRAY <<< "$CHOOSE"
for i in "${CHOOSE_ARRAY[@]}"; do
if [ "$i" -eq "1" ]; then
if [ "$(command -v gpg)" ]; then
echo "sync_gnupg" >> dotfiles.sh
else
echo "GPG is not installed. Skipping."
fi
elif [ "$i" -eq "2" ]; then
if [ "$(command -v omz)" ]; then
echo "sync_zshrc" >> dotfiles.sh
echo "sync_zsh_scripts" >> dotfiles.sh
else
echo "zsh is not installed. Skipping."
fi
elif [ "$i" -eq "3" ]; then
if [ "$(command -v git)" ]; then
echo "sync_git_files" >> dotfiles.sh
else
echo "git is not installed. Skipping."
fi
elif [ "$i" -eq "4" ]; then
if [ "$(command -v vim)" ]; then
echo "sync_vim_config" >> dotfiles.sh
else
echo "vim is not installed. Skipping."
fi
elif [ "$i" -eq "5" ]; then
echo "sync_bin_dir" >> dotfiles.sh
elif [ "$i" -eq "6" ]; then
if [ "$(command -v npm)" ]; then
echo "sync_npm" >> dotfiles.sh
else
echo "npm is not installed. Skipping."
fi
elif [ "$i" -eq "7" ]; then
if [ "$(command -v amfora)" ]; then
echo "sync_amfora" >> dotfiles.sh
else
echo "amfora is not installed. Skipping."
fi
elif [ "$i" -eq "8" ]; then
if [ "$(command -v bat)" ]; then
echo "sync_bat" >> dotfiles.sh
else
echo "bat is not installed. Skipping."
fi
elif [ "$i" -eq "9" ]; then
if [ "$(command -v lazygit)" ]; then
echo "sync_lazygit" >> dotfiles.sh
else
echo "lazygit is not installed. Skipping."
fi
elif [ "$i" -eq "10" ]; then
if [ "$(command -v lsd)" ]; then
echo "sync_lsd" >> dotfiles.sh
else
echo "lsd is not installed. Skipping."
fi
elif [ "$i" -eq "11" ]; then
if [ "$(command -v poetry)" ]; then
echo "sync_poetry" >> dotfiles.sh
else
echo "poetry is not installed. Skipping."
fi
elif [ "$i" -eq "12" ]; then
if [ "$(command -v ngrok)" ]; then
echo "sync_ngrok" >> dotfiles.sh
else
echo "ngrok is not installed. Skipping."
fi
elif [ "$i" -eq "13" ]; then
if [ "$(command -v starship)" ]; then
echo "sync_starship" >> dotfiles.sh
else
echo "starship is not installed. Skipping."
fi
elif [ "$i" -eq "14" ]; then
if [ "$(command -v topgrade)" ]; then
echo "sync_topgrade" >> dotfiles.sh
else
echo "topgrade is not installed. Skipping."
fi
elif [ "$i" -eq "15" ]; then
echo "sync_all" >> dotfiles.sh
break 2
elif [ "$i" = "q" ]; then
echo "Exiting..."
break 2
fi
done
done
sh dotfiles.sh
printf "Dotfiles Installation/Syncing Done.\n"
printf "It's recommended to restart your device. If you encountered any bugs/mistakes:\n"
printf "Please raise an issue at https://github.com/Kunal2007-web/KDotfiles/issues"