diff options
| author | stkhan <personal@slickd.xyz> | 2024-01-10 18:24:12 +0000 |
|---|---|---|
| committer | stkhan <personal@slickd.xyz> | 2024-01-10 18:24:12 +0000 |
| commit | bd6dd9b9668043ab2b4858f7bc90ef83b6fd46f5 (patch) | |
| tree | a26df70f553334166824f23b61de6885200b05bd /depm | |
| parent | 9b160a482ac271fb5678e15007752f5711731050 (diff) | |
Diffstat (limited to 'depm')
| -rwxr-xr-x | depm | 21 |
1 files changed, 19 insertions, 2 deletions
@@ -2,6 +2,7 @@ os=$(cat /etc/os-release | grep ID | head -n 1) DEPMFILE=Depmfile +superuser="sudo" if [[ ! -f Depmfile ]]; then echo "This repository does not have a Depmfile." @@ -10,18 +11,34 @@ fi install_arch() { ARCH_PACKAGES=$(grep ARCH_PACKAGES ${DEPMFILE} | sed 's/ARCH_PACKAGES: //g') + AUR_PACKAGES=$(grep AUR_PACKAGES ${DEPMFILE} | sed 's/AUR_PACKAGES: //g') + + if [[ $AUR_PACKAGES == "" ]]; then + echo "Repository does not have any AUR dependencies" + else + if [[ -f /usr/bin/yay ]]; then + yay -S --needed ${AUR_PACKAGES} + elif [[ -f /usr/bin/paru ]]; then + paru -S --needed ${AUR_PACKAGES} + else + echo "AUR helper not found" + fi + fi + if [[ $ARCH_PACKAGES == "" ]]; then echo "Repository does not have any dependencies for Arch Linux" else - pacman -S --needed $ARCH_PACKAGES + echo "WARNING: depm will install these with superuser privileges" + $superuser pacman -S --needed $ARCH_PACKAGES fi + echo Finished } case $os in "ID=arch") install_arch;; "ID=artix") - echo "WARNING: You may need standard Arch Linux repositories enabled in pacman." + echo -e "\e[33mWARNING: You may need standard Arch Linux repositories enabled in pacman" install_arch;; *) echo "Unknown OS\n You must manually install dependencies";; |