This commit is contained in:
pika 2025-05-16 09:58:17 +02:00
parent 53228ddbb9
commit c7e49404ea

View file

@ -7,6 +7,12 @@ command_exists() {
command -v "$@" >/dev/null 2>&1
}
if command_exists $PACKAGE; then
echo_warning "$PACKAGE is alread installed!"
echo_warning "Exiting now!"
exit 69
fi
# WHY:
# This import will give you the following variables:
# _sudo="sudo -E" <- only if non root user
@ -65,13 +71,11 @@ getDependencies() {
# ╰────────────────────────────────────────────────────────────────╯
declare -n pkgArray="${deps[$distro]}"
case "$distro" in
debian) checkAndInstall "${pkgArray[@]}" ;;
*)
echo_error "There are no dependencies to install for $distro"
return 69
;;
esac
if checkComp; then
for pkg in "${pkgArray[@]}"; do
checkAndInstall "$pkg"
done
fi
}
build() {
@ -81,8 +85,8 @@ build() {
}
cloneAndInstall() {
# local cloneDir="$(mktemp -d)"
local cloneDir="$HOME/.builds"
local cloneDir="$(mktemp -d)"
# local cloneDir="$HOME/.builds"
cd $cloneDir || mkdir -p $cloneDir && cd $cloneDir
@ -110,10 +114,12 @@ main() {
esac
}
if ! $arch || ! $debian; then
echo_error "Your distro $distro is not supported by this script!"
exit 69
fi
checkComp() {
if ! $arch && ! $debian; then
echo_error "Your distro $distro is not compatible with this script"
return 69
fi
}
if getImports; then
silent=false