From 43fcb210ca58c25f3b1724686c9861e0bf01c32b Mon Sep 17 00:00:00 2001 From: Santiago Lo Coco Date: Thu, 6 Jan 2022 22:57:37 -0300 Subject: [PATCH] Refactor --- install.sh | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/install.sh b/install.sh index edd475e..de8a31b 100755 --- a/install.sh +++ b/install.sh @@ -124,7 +124,7 @@ partDisks() { } getSize() { - sizeStr=$(whiptail --inputbox "Enter the size of the ${1} (in GB)." 0 0 3>&1 1>&2 2>&3) + sizeStr=$(whiptail --inputbox "Enter the size of the ${1} (in GB, for example 1.5GB)." 0 0 3>&1 1>&2 2>&3) exitIfCancel "You must enter a size." size=$(echo "$sizeStr" | grep -Eo '[-]?[0-9]+([.,]?[0-9]+)?' | head -n1 | sed 's/,/./g' | awk '{ print int($1 * 1024) }') while [ $(echo $size | awk '{ print $1 <= 0 }') -eq 1 ]; do @@ -333,7 +333,7 @@ calcWidthAndRun() { fi commOutput=$(eval $comm) exitStatus=$? - [ ! -z $commOutput ] && echo $commOutput + [ -n $commOutput ] && echo $commOutput return $exitStatus } @@ -351,7 +351,7 @@ calcHeightAndRun() { fi commOutput=$(eval $comm) exitStatus=$? - [ ! -z $commOutput ] && echo $commOutput + [ -n $commOutput ] && echo $commOutput return $exitStatus } @@ -476,12 +476,6 @@ finishInstallation() { fi } -zshConfig() { - # TODO: Choose between zsh-theme-powerlevel10k-git (AUR) and zsh-theme-powerlevel10k (community) - mkdir -p $HOME/.cache/zsh - touch $HOME/.cache/zsh/.histfile -} - getDotfiles() { zshConfig local lastFolder=$(pwd -P) @@ -492,6 +486,8 @@ getDotfiles() { cd $lastFolder sudo rm -f ~/.bashrc /usr/bin/CocoASAIS + mkdir -p $HOME/.cache/zsh + touch $HOME/.cache/zsh/.histfile chsh -s $(which zsh) }