Skip to content
This repository has been archived by the owner on Jan 1, 2023. It is now read-only.

Commit

Permalink
Add the ability to select if you want to delete directly the script w…
Browse files Browse the repository at this point in the history
…hen finished (version 1.4)
  • Loading branch information
RaptaG authored Jul 5, 2022
1 parent b8e646a commit c1d2d33
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions CAAIS.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
set -e

# Definitions
ver=1.3
ver=1.4
fname=$(basename $0)

caais-exit() {
Expand Down Expand Up @@ -38,8 +38,8 @@ caais() {

# Checking if Chaotic-AUR is already appended in pacman.conf, if not skip
echo 'Appending Chaotic-AUR to the mirrorlist...'

appendInPacmanConf=$(grep 'chaotic-aur' /etc/pacman.conf)

if [ $appendInPacmanConf -eq 0 ]; then
echo 'Chaotic-AUR is already append in pacman.conf, skipping...'
else
Expand All @@ -50,9 +50,9 @@ caais() {
echo 'Refreshing the mirrorlists...'

echo -n 'Doing this is needed for Chaotic-AUR to work, but will also cause a system upgrade. Do you wish to continue? [Y/n] '
read answer
read answer1

case "$answer" in
case "$answer1" in
[yY]* | "")
pacman -Syu
;;
Expand All @@ -63,7 +63,24 @@ caais() {
esac
}

# Select if you want to delete the script
delete-caais() {
echo -n 'Since Chaotic-AUR is installed, this program has no use. Would you like to delete it [Y/n] '
read answer2

case "$answer2" in
[yY]* | "")
echo 'Deleting...'
rm $fname
caais-exit
;;
*)
caais-exit
;;
esac
}

# Running the script
caais "$@"
echo 'Done! Now Chaotic-AUR should be installed and working in your system!'
caais-exit
delete-caais "$@"

0 comments on commit c1d2d33

Please sign in to comment.