diff --git a/simpleaur b/simpleaur index 088864a..5e88730 100755 --- a/simpleaur +++ b/simpleaur @@ -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