Fix issue when deleting the previous compiled packages

When you tried to delete 'HOME/.simpleaur/Build/*' it fail because the directory are in quotes and don't take the '*', also fixed the issue when the 'basebuilddir' doesn't exist and simpleaur try first to create the lockfile and before check if the 'basebuilddir' exist (logical problem)
This commit is contained in:
Eduard Tolosa 2018-07-22 20:48:23 -05:00
parent 3ed4574315
commit d965786203

View file

@ -12,6 +12,11 @@ ctrl_c() {
trap ctrl_c SIGINT
#Check if the base Build DIR exists, if not create it.
if [ ! -d "$basebuilddir" ]; then
mkdir -p "$basebuilddir"
fi
#Prevent two instances running at same time
if [ -f "$lockfile" ]; then
printf "\n\e[1;31m%-6s\e[m%s\n" "simpleaur is running, leaving."
@ -20,6 +25,7 @@ if [ -f "$lockfile" ]; then
else
touch "$lockfile"
fi
#Make sure that you are using an ArchLinux system
if [ -x "$pacmanexist" ]; then
continue
@ -29,11 +35,6 @@ else
exit
fi
#Check if the base Build DIR exists, if not create it.
if [ ! -d "$basebuilddir" ]; then
mkdir -p "$basebuilddir"
fi
if [[ "$@" ]]; then
cd "$basebuilddir" || exit
else
@ -97,7 +98,7 @@ read -p "Remove previously compiled packages? [Y/n]? " yn
#Take the answer from the user input and decide what to do.
if [ "$yn" = "y" ]; then
printf "\n\e[1;32m%-6s\e[m\n%s\n" "Info: Removing build directory..."
rm -rf "$basebuilddir/*"
rm -rf "$basebuilddir"
else
printf "\n\e[1;32m%-6s\e[m\n%s\n" "Info: Instalation completed."
fi