Skip to content

Commit e8dac6c

Browse files
committed
fixed some crucial bugs
1 parent 599ede0 commit e8dac6c

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

src/inst.sh

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ inst_pacman_pkgs() {
4646
if [[ -n "$pkgs" ]]; then
4747
echo -e "following packages will be installed ...\n$pkgs"
4848
sudo pacman -Syu --noconfirm --needed $pkgs && echo "installation successfully" && return 0
49-
echo "installation failed"
49+
echo "pacman - installation failed"
5050
else
5151
echo "pkg files are empty; abort installation"
5252
fi
@@ -62,8 +62,8 @@ inst_yay_pkgs() {
6262
pkgs=$(grep -hvE "^\s*#|^\s*$" "$@")
6363
if [[ -n "$pkgs" ]]; then
6464
echo -e "following packages will be installed ...\n$pkgs"
65-
sudo pacman -Syu --noconfirm --needed $pkgs && echo "installation successfully" && return 0
66-
echo "installation failed"
65+
yay -Syu --noconfirm --needed $pkgs && echo "installation successfully" && return 0
66+
echo "Yay - installation failed"
6767
else
6868
echo "pkg files are empty; abort installation"
6969
fi
@@ -81,7 +81,7 @@ inst_flatpak_pkgs() {
8181
echo -e "following packages will be installed ...\n$pkgs"
8282
for pkg in "$pkgs"; do
8383
flatpak install -y flathub $pkg && echo "installation of *$pkg* successfully" && return 0
84-
echo "installation failed"
84+
echo "Flatpak - installation failed"
8585
done
8686
else
8787
echo "pkg files are empty; abort installation"
@@ -106,7 +106,7 @@ load_modules() {
106106
kernel_modules=$(grep -hvE "^\s*#|^\s*$" "$modules_list")
107107
if [[ -n "$kernel_modules" ]]; then
108108
echo "$kernel_modules"
109-
sudo modprobe "$kernel_modules" && return 0
109+
sudo modprobe $kernel_modules && return 0
110110
else
111111
echo "*$modules_list* is empty"
112112
fi
@@ -136,7 +136,11 @@ service_setup() {
136136
}
137137

138138
# installing packages
139-
inst_packages && load_modules || exit 1
139+
if ! ( inst_packages && load_modules ); then
140+
echo "required installation process failed"
141+
exit 1
142+
fi
143+
140144
# services (no automatic aborting)
141145
psql_setup # setup postgresql
142146
service_setup # other services

0 commit comments

Comments
 (0)