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