From e766866207e88b4c1e9b4112a52b524bf02f062d Mon Sep 17 00:00:00 2001 From: JaKooLit Date: Fri, 7 Feb 2025 19:57:11 +0900 Subject: [PATCH] updated install scripts for AUR --- install-scripts/paru.sh | 27 +++++++++++++-------------- install-scripts/yay.sh | 19 ++++++++++--------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/install-scripts/paru.sh b/install-scripts/paru.sh index 2e057af..14388ce 100755 --- a/install-scripts/paru.sh +++ b/install-scripts/paru.sh @@ -3,10 +3,11 @@ # Paru AUR Helper # # NOTE: If yay is already installed, paru will not be installed # +pkg="paru-bin" ## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ## # Set the name of the log file to include the current date and time -LOG="install-$(date +%d-%H%M%S)_paru.log" +LOG="install-$(date +%d-%H%M%S)_yay.log" # Set some colors for output messages OK="$(tput setaf 2)[OK]$(tput sgr0)" @@ -24,30 +25,28 @@ BLUE="$(tput setaf 4)" SKY_BLUE="$(tput setaf 6)" RESET="$(tput sgr0)" - # Create Directory for Install Logs if [ ! -d Install-Logs ]; then mkdir Install-Logs fi -# checking if paru exist and removing if it is -if [ -d paru-bin ]; then - rm -rf paru-bin 2>&1 | tee -a "$LOG" -fi - # Check for AUR helper and install if not found ISAUR=$(command -v yay || command -v paru) - if [ -n "$ISAUR" ]; then printf "\n%s - ${SKY_BLUE}AUR helper${RESET} already installed, moving on.\n" "${OK}" else - printf "\n%s - Installing ${SKY_BLUE}paru-bin${RESET} from AUR\n" "${NOTE}" - git clone https://aur.archlinux.org/paru-bin.git || { printf "%s - Failed to clone ${YELLOW}paru-bin${RESET} from AUR\n" "${ERROR}"; exit 1; } - cd paru-bin || { printf "%s - Failed to enter paru directory\n" "${ERROR}"; exit 1; } - makepkg -si --noconfirm 2>&1 | tee -a "$LOG" || { printf "%s - Failed to install ${YELLOW}paru-bin${RESET} from AUR\n" "${ERROR}"; exit 1; } - + printf "\n%s - Installing ${SKY_BLUE}$pkg${RESET} from AUR\n" "${NOTE}" + +# Check if folder exists and remove it +if [ -d "$pkg" ]; then + rm -rf "$pkg" +fi + git clone https://aur.archlinux.org/$pkg.git || { printf "%s - Failed to clone ${YELLOW}$pkg${RESET} from AUR\n" "${ERROR}"; exit 1; } + cd $pkg || { printf "%s - Failed to enter $pkg directory\n" "${ERROR}"; exit 1; } + makepkg -si --noconfirm 2>&1 | tee -a "$LOG" || { printf "%s - Failed to install ${YELLOW}$pkg${RESET} from AUR\n" "${ERROR}"; exit 1; } + # moving install logs in to Install-Logs folder - mv install*.log ../Install-Logs/ || true + mv install*.log ../Install-Logs/ || true cd .. fi diff --git a/install-scripts/yay.sh b/install-scripts/yay.sh index e3b2a7d..a08042d 100755 --- a/install-scripts/yay.sh +++ b/install-scripts/yay.sh @@ -3,6 +3,7 @@ # Yay AUR Helper # # NOTE: If paru is already installed, yay will not be installed # +pkg="yay-bin" ## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ## # Set the name of the log file to include the current date and time @@ -29,20 +30,20 @@ if [ ! -d Install-Logs ]; then mkdir Install-Logs fi -# Check Existing yay -if [ -d yay ]; then - rm -rf yay 2>&1 | tee -a "$LOG" -fi - # Check for AUR helper and install if not found ISAUR=$(command -v yay || command -v paru) if [ -n "$ISAUR" ]; then printf "\n%s - ${SKY_BLUE}AUR helper${RESET} already installed, moving on.\n" "${OK}" else - printf "\n%s - Installing ${SKY_BLUE}yay-bin${RESET} from AUR\n" "${NOTE}" - git clone https://aur.archlinux.org/yay-bin.git || { printf "%s - Failed to clone ${YELLOW}yay${RESET} from AUR\n" "${ERROR}"; exit 1; } - cd yay || { printf "%s - Failed to enter yay directory\n" "${ERROR}"; exit 1; } - makepkg -si --noconfirm 2>&1 | tee -a "$LOG" || { printf "%s - Failed to install ${YELLOW}yay${RESET} from AUR\n" "${ERROR}"; exit 1; } + printf "\n%s - Installing ${SKY_BLUE}$pkg${RESET} from AUR\n" "${NOTE}" + +# Check if folder exists and remove it +if [ -d "$pkg" ]; then + rm -rf "$pkg" +fi + git clone https://aur.archlinux.org/$pkg.git || { printf "%s - Failed to clone ${YELLOW}$pkg${RESET} from AUR\n" "${ERROR}"; exit 1; } + cd $pkg || { printf "%s - Failed to enter $pkg directory\n" "${ERROR}"; exit 1; } + makepkg -si --noconfirm 2>&1 | tee -a "$LOG" || { printf "%s - Failed to install ${YELLOW}$pkg${RESET} from AUR\n" "${ERROR}"; exit 1; } # moving install logs in to Install-Logs folder mv install*.log ../Install-Logs/ || true