minor update
This commit is contained in:
@@ -25,15 +25,15 @@ if [ ! -d Install-Logs ]; then
|
|||||||
mkdir Install-Logs
|
mkdir Install-Logs
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Function that would show a progress
|
# Show progress function
|
||||||
show_progress() {
|
show_progress() {
|
||||||
local pid=$1
|
local pid=$1
|
||||||
local package_name=$2
|
local package_name=$2
|
||||||
local spin_chars=("●○○○○○" "○●○○○○" "○○●○○○" "○○○●○○" "○○○○●○" "○○○○○●" \
|
local spin_chars=("●○○○○○○○○○" "○●○○○○○○○○" "○○●○○○○○○○" "○○○●○○○○○○" "○○○○●○○○○" \
|
||||||
"○○○○●○" "○○○●○○" "○○●○○○" "○●○○○○") # Growing & Shrinking Dots
|
"○○○○○●○○○○" "○○○○○○●○○○" "○○○○○○○●○○" "○○○○○○○○●○" "○○○○○○○○○●")
|
||||||
local i=0
|
local i=0
|
||||||
|
|
||||||
tput civis # Hide cursor
|
tput civis
|
||||||
printf "\r${NOTE} Installing ${YELLOW}%s${RESET} ..." "$package_name"
|
printf "\r${NOTE} Installing ${YELLOW}%s${RESET} ..." "$package_name"
|
||||||
|
|
||||||
while ps -p $pid &> /dev/null; do
|
while ps -p $pid &> /dev/null; do
|
||||||
@@ -42,11 +42,12 @@ show_progress() {
|
|||||||
sleep 0.3
|
sleep 0.3
|
||||||
done
|
done
|
||||||
|
|
||||||
printf "\r${NOTE} Installing ${YELLOW}%s${RESET} ... Done!%-20s\n" "$package_name" ""
|
printf "\r${NOTE} Installing ${YELLOW}%s${RESET} ... Done!%-20s \n" "$package_name" ""
|
||||||
tput cnorm
|
tput cnorm
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Function to install packages with pacman
|
# Function to install packages with pacman
|
||||||
install_package_pacman() {
|
install_package_pacman() {
|
||||||
# Check if package is already installed
|
# Check if package is already installed
|
||||||
@@ -73,11 +74,9 @@ ISAUR=$(command -v yay || command -v paru)
|
|||||||
|
|
||||||
# Function to install packages with either yay or paru
|
# Function to install packages with either yay or paru
|
||||||
install_package() {
|
install_package() {
|
||||||
# Checking if package is already installed
|
|
||||||
if $ISAUR -Q "$1" &>> /dev/null ; then
|
if $ISAUR -Q "$1" &>> /dev/null ; then
|
||||||
echo -e "${INFO} ${MAGENTA}$1${RESET} is already installed. Skipping..."
|
echo -e "${INFO} ${MAGENTA}$1${RESET} is already installed. Skipping..."
|
||||||
else
|
else
|
||||||
# Run yay/paru and redirect all output to a log file
|
|
||||||
(
|
(
|
||||||
stdbuf -oL $ISAUR -S --noconfirm --needed "$1" 2>&1
|
stdbuf -oL $ISAUR -S --noconfirm --needed "$1" 2>&1
|
||||||
) >> "$LOG" 2>&1 &
|
) >> "$LOG" 2>&1 &
|
||||||
|
|||||||
Reference in New Issue
Block a user