From 6c78d63c28663444f8d08fb230ba24df087d5bc1 Mon Sep 17 00:00:00 2001 From: Luca Bilke Date: Thu, 28 Mar 2024 16:24:16 +0100 Subject: [PATCH] remove tput fuckery --- bootstrap.sh | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/bootstrap.sh b/bootstrap.sh index ee00527..8a70671 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -50,14 +50,11 @@ _loop_wrapper() { skip_regex="^(#.*)?$" total=$(grep -cvP "$skip_regex" "$file") - tput sc while read -r x; do echo "$x" | grep -qvP "$skip_regex" || continue n=$((n + 1)) eval "info \"(${n}/${total}) $message\"" eval "$command" - tput rc - tput el done <"$file" } @@ -67,22 +64,15 @@ check_root() { } setup() { - tput sc info "Synchronizing XBPS index..." xbps-install -S >/dev/null 2>&1 || error "Failed to synchronize XBPS index! (Try manually running xbps-install -S)" - tput rc - tput el if ! xbps-query ntp >/dev/null 2>&1; then info "Installing ntp..." xbps-install -y ntp >/dev/null 2>&1 - tput rc - tput el info "Synchronizing time..." ntpdate "pool.ntp.org" >/dev/null 2>&1 || warn "Failed to synchronize time!" - tput rc - tput el fi info "Done!" @@ -105,15 +95,11 @@ install_files() { } create_user() { - tput sc - failed=false while ! echo "$username" | grep "^[a-z_][a-z0-9_-]*$" | grep -qv "root"; do $failed && warn "Invalid username, try again!" username=$(prompt "Input Username: ") failed=true - tput rc - tput el done if id -u "$username" >/dev/null 2>&1; then @@ -125,14 +111,8 @@ create_user() { failed=false while [ -z "$pass1" ] || [ "$pass1" != "$pass2" ]; do $failed && warn "Passwords do not match or are empty, try again!" - tput rc - tput el pass1=$(prompt "Input Password: ") - tput rc - tput el pass2=$(prompt "Repeat Password: ") - tput rc - tput el failed=true done echo "$username:$pass1" | chpasswd @@ -162,28 +142,19 @@ create_directories() { } install_dotfiles() { - tput sc info "Cloning dotfiles..." mkdir -p "${user_home}/${STOW_DIR}" if [ ! -d "${user_home}/${STOW_DIR}/${DOTS_PACKAGE}/.git" ]; then if ! git -C "${user_home}/${STOW_DIR}" clone -q --recurse-submodules -b "$DOTS_BRANCH" "$DOTS_REPO" "$DOTS_PACKAGE"; then - tput rc - tput el warn "Failed to clone dotfiles" return 1 fi fi - tput rc - tput el info "Symlinking dotfiles..." if ! stow -d "$user_home/$STOW_DIR" -t "$user_home" "$DOTS_PACKAGE" 1>/dev/null 2>&1; then - tput rc - tput el warn "Failed to symlink dotfiles" return 2 fi - tput rc - tput el info "Done!" }