aboutsummaryrefslogtreecommitdiff
path: root/install.sh
diff options
context:
space:
mode:
authorkaotisk <kaotisk@arching-kaos.org>2024-12-16 01:58:14 +0200
committerkaotisk <kaotisk@arching-kaos.org>2024-12-16 01:58:14 +0200
commit2ce602f212ba1da19cf59f8e39946c13b977bb84 (patch)
tree1544173b57dce72a21560989c13b5c4c45bda6ac /install.sh
parent3a503ee816c858b86264376c3bc4bb3ff2635655 (diff)
downloadarching-kaos-tools-2ce602f212ba1da19cf59f8e39946c13b977bb84.tar.gz
arching-kaos-tools-2ce602f212ba1da19cf59f8e39946c13b977bb84.tar.bz2
arching-kaos-tools-2ce602f212ba1da19cf59f8e39946c13b977bb84.zip
Refactoring
Diffstat (limited to 'install.sh')
-rwxr-xr-xinstall.sh63
1 files changed, 32 insertions, 31 deletions
diff --git a/install.sh b/install.sh
index 32bddda..6d91c36 100755
--- a/install.sh
+++ b/install.sh
@@ -29,13 +29,6 @@
## We discourage running the installer with sudo.
##
clear
-export AK_DEBUG="yes"
-fullprogrampath="$(realpath $0)"
-PROGRAM="$(basename $0)"
-descriptionString="Arching Kaos Tools Installer"
-
-source ./lib/_ak_script
-_ak_usage
if [ -d ~/.arching-kaos ]
then
@@ -44,6 +37,37 @@ then
exit 1
fi
+source ./config.sh
+if [ $? -ne 0 ]
+then
+ printf "Error: Sourcing ./config.sh failed"
+ exit 2
+fi
+
+printf "%s" $(pwd) > wam
+WHEREAMI="$(cat wam)"
+if [ ! -d $AK_WORKDIR ]
+then
+ mkdir $AK_WORKDIR
+else
+ printf "Error: Found %s.\n" "$AK_WORKDIR"
+ printf "Please back up your previous installation\n"
+ printf "and rerun ./install.sh.\n"
+ exit 3
+fi
+
+touch $AK_LOGSFILE
+
+source ./lib/_ak_log
+
+export AK_DEBUG="yes"
+fullprogrampath="$(realpath $0)"
+PROGRAM="$(basename $0)"
+descriptionString="Arching Kaos Tools Installer"
+
+source ./lib/_ak_script
+_ak_usage
+
printf "Installation starts in..."
countdown_seconds(){
@@ -78,31 +102,8 @@ countdown_seconds(){
printf "\n"
}
-countdown_seconds 10
-
-
-source ./config.sh
-if [ $? -ne 0 ]
-then
- printf "Error: Sourcing ./config.sh failed"
- exit 2
-fi
-
-printf "%s" $(pwd) > wam
-WHEREAMI="$(cat wam)"
-if [ ! -d $AK_WORKDIR ]
-then
- mkdir $AK_WORKDIR
-else
- printf "Error: Found %s.\n" "$AK_WORKDIR"
- printf "Please back up your previous installation\n"
- printf "and rerun ./install.sh.\n"
- exit 3
-fi
+countdown_seconds 5
-touch $AK_LOGSFILE
-
-source ./lib/_ak_log
_ak_check_and_create_dir $AK_CONFIGDIR
_ak_check_and_create_dir $AK_BINDIR