From 7e43159da7bedae2cb162150965e4e98c81bed32 Mon Sep 17 00:00:00 2001 From: pika Date: Sun, 18 May 2025 17:34:42 +0200 Subject: [PATCH] wip --- yazi.sh | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/yazi.sh b/yazi.sh index 872734d..287eaea 100644 --- a/yazi.sh +++ b/yazi.sh @@ -57,6 +57,54 @@ rm "$import" } + getDependencies() { + echo_info "Checking build dependencies.." + + # INFO: + # ╭─────────────────────────────────────────────────────────────────────────╮ + # │ You can define dependencies for various linux distros here. It will │ + # │ automagically be pulled via the $pkgArray[$distro] variable │ + # ╰─────────────────────────────────────────────────────────────────────────╯ + depsDebian=(libpoppler-dev) + depsFedora=() + depsOpensuse=() + depsArch=() + depsAlpine=() + + generalDeps=( + ffmpeg + make + gcc + 7zip + ) + + declare -A deps=( + [debian]="depsDebian" + [ubuntu]="depsUbuntu" + [fedora]="depsFedora" + [arch]="depsArch" + [alpine]="depsAlpine" + [opensuse]="depsOpensuse" + ) + + # INFO: + # ╭────────────────────────────────────────────────────────────────╮ + # │ This variable stores the packages you provided for each distro │ + # ╰────────────────────────────────────────────────────────────────╯ + declare -n pkgArray="${deps[$distro]}" + + case "$distro" in + debian | ubuntu | arch | fedora | alpine | opensuse) + checkAndInstall "${generalDeps[@]}" + checkAndInstall "${pkgArray[@]}" + ;; + *) + echo_error "There are no dependencies to install for $distro" + return 69 + ;; + esac + } + checkDependencies() { local deps=( ffmpeg