updated install scripts for AUR

This commit is contained in:
JaKooLit
2025-02-07 19:57:11 +09:00
parent fb9b3a8205
commit e766866207
2 changed files with 23 additions and 23 deletions

View File

@@ -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

View File

@@ -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