File tree Expand file tree Collapse file tree 2 files changed +52
-4
lines changed Expand file tree Collapse file tree 2 files changed +52
-4
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,27 @@ detect_distro() {
12
12
fi
13
13
}
14
14
15
+ check_essential_dependencies () {
16
+ local dependencies=(" git" " wget" " curl" )
17
+ local missing=()
18
+
19
+ for dep in " ${dependencies[@]} " ; do
20
+ if ! command -v " $dep " & > /dev/null; then
21
+ missing+=(" $dep " )
22
+ fi
23
+ done
24
+
25
+ if [[ ${# missing[@]} -ne 0 ]]; then
26
+ echo " Please wait, installing required dependencies..."
27
+
28
+ case " $distro " in
29
+ arch) sudo pacman -S --noconfirm " ${missing[@]} " > /dev/null 2>&1 ;;
30
+ fedora) sudo dnf install -y " ${missing[@]} " > /dev/null 2>&1 ;;
31
+ * ) echo -e " ${RED} Unsupported distribution.${RESET} " ; exit 1 ;;
32
+ esac
33
+ fi
34
+ }
35
+
15
36
check_fzf () {
16
37
if ! command -v fzf & > /dev/null; then
17
38
echo -e " ${CYAN} Installing fzf...${RESET} "
@@ -53,6 +74,7 @@ echo -e "${RESET}"
53
74
echo -e " ${BLUE} Nerd Font Are Recommended${RESET} "
54
75
55
76
detect_distro
77
+ check_essential_dependencies
56
78
check_fzf
57
79
58
80
echo -e " ${CYAN} Detected distribution: $distro ${RESET} "
Original file line number Diff line number Diff line change @@ -40,6 +40,30 @@ fzf_confirm() {
40
40
fi
41
41
}
42
42
43
+ check_essential_dependencies () {
44
+ local dependencies=(" git" " wget" " curl" )
45
+ local missing=()
46
+
47
+ for dep in " ${dependencies[@]} " ; do
48
+ if ! command -v " $dep " & > /dev/null; then
49
+ missing+=(" $dep " )
50
+ fi
51
+ done
52
+
53
+ if [[ ${# missing[@]} -ne 0 ]]; then
54
+ echo " Please wait, installing required dependencies..."
55
+
56
+ if command -v pacman & > /dev/null; then
57
+ sudo pacman -S --noconfirm " ${missing[@]} " > /dev/null 2>&1
58
+ elif command -v dnf & > /dev/null; then
59
+ sudo dnf install -y " ${missing[@]} " > /dev/null 2>&1
60
+ else
61
+ print_message " $RED " " Unsupported package manager. Install dependencies manually."
62
+ exit 1
63
+ fi
64
+ fi
65
+ }
66
+
43
67
check_aur_helper () {
44
68
if command -v yay & > /dev/null; then
45
69
AUR_HELPER=" yay"
@@ -93,8 +117,14 @@ echo -e "${RESET}"
93
117
94
118
detect_distro
95
119
120
+ check_essential_dependencies
121
+
96
122
install_fzf
97
123
124
+ if command -v pacman & > /dev/null; then
125
+ check_aur_helper
126
+ fi
127
+
98
128
install_zsh_dependencies () {
99
129
print_message " $CYAN " " Installing Zsh dependencies..."
100
130
if command -v pacman & > /dev/null; then
@@ -226,10 +256,6 @@ install_zoxide() {
226
256
fi
227
257
}
228
258
229
- if command -v pacman & > /dev/null; then
230
- check_aur_helper
231
- fi
232
-
233
259
install_zsh_dependencies
234
260
install_powerlevel10k
235
261
install_ohmyzsh
You can’t perform that action at this time.
0 commit comments