Merge Release 1.7.2 to main #5

Merged
ffqq merged 4 commits from staging into main 2022-09-05 05:33:23 +00:00

34
liteaur
View File

@ -11,11 +11,9 @@ esac
DUMP=$HOME/.cache/liteaur
# Config
CONFIGFOLDER=$HOME/.config/liteaur
# Cache
mkdir -p "$DUMP"/cache
# Version number
VERSION='1.7.1'
VERSION='1.7.2'
# Colors
G='\033[0;32m'
@ -35,6 +33,17 @@ SKIPPGPCHECK="false"
SKIPINSTALLVERIFICATION="false"
source "$CONFIGFOLDER"/config.sh 2>/dev/null
# Credits to stackoverflow for this <3
spinner() {
local i sp n
sp='/-\|'
n=${#sp}
printf ' '
while sleep 0.1; do
printf "%s\b" "${sp:i++%n:1}"
done
}
print_no_argument() {
echo -e "${R}${B}error: ${NC}no operation provided (use -h for help)";
exit 1;
@ -43,6 +52,7 @@ print_no_argument() {
help() {
printf "%s\n" "usage: liteaur <operation> [...]
liteaur -i Install AUR package(s)
liteaur -r Remove package(s) from update cache
liteaur -u Upgrade all available AUR packages
liteaur -s Searches for a package in the AUR
liteaur -v Prints the version of LiteAUR
@ -164,11 +174,29 @@ update() {
rm -f "$DUMP"/lck.db;
}
removecache() {
for var in "${@:1}"; do
if [ -d "$DUMP/$var" ]; then
printf "${G}${B}==> ${NC}${B}removing cached package: $var "
spinner &
rm -rf "$DUMP/$var"
kill "$!"
printf "\n"
printf "${G}${B}==> ${NC}${B}cached package successfully removed: $var\n"
else
printf "${R}${B}==> ERROR: ${NC}${B}package not in update cache: $var\n";
rm -f "$DUMP"/lck.db;
exit 1;
fi
done
}
case $1 in
"-i") install_init "${@:2}" ;;
"-s") search "$2" ;;
"-u") update ;;
"-v") printf "LiteAUR ${VERSION}\n" ;;
"-h") help ;;
"-r") removecache "${@:2}" ;;
* ) print_no_argument
esac