From fbd1dd041936c446f5e22fbf74b5d27d510eb3d1 Mon Sep 17 00:00:00 2001 From: Nathaniel Landau Date: Thu, 18 Nov 2021 09:46:30 -0500 Subject: [PATCH] update spinner output --- .hooks | 2 +- template_standalone.sh | 44 +++++++++++++++++++++--------------------- utilities/misc.bash | 38 ++++++++++++++++++------------------ 3 files changed, 42 insertions(+), 42 deletions(-) diff --git a/.hooks b/.hooks index af6e81c..3c2c0e8 160000 --- a/.hooks +++ b/.hooks @@ -1 +1 @@ -Subproject commit af6e81c37db9550bfd2fb539277693ca436b4baf +Subproject commit 3c2c0e85ae968ff5b7521ee028fcf9b7c11abbdd diff --git a/template_standalone.sh b/template_standalone.sh index 1e893f6..c4d6950 100755 --- a/template_standalone.sh +++ b/template_standalone.sh @@ -353,28 +353,6 @@ _makeTempDir_() { debug "\$TMP_DIR=${TMP_DIR}" } -_homebrewPath_() { - # DESC: - # Add homebrew bin dir to PATH - # ARGS: - # None - # OUTS: - # 0 if successful - # 1 if unsuccessful - # PATH: Adds homebrew bin directory to PATH - # USAGE: - # # if ! _homebrewPath_; then exit 1; fi - - ! declare -f "_setPATH_" &>/dev/null && fatal "${FUNCNAME[0]} needs function _setPATH_" - - if _setPATH_ "/usr/local/bin" "/opt/homebrew/bin"; then - return 0 - else - return 1 - fi - -} - # shellcheck disable=SC2120 _acquireScriptLock_() { # DESC: @@ -501,6 +479,28 @@ _useGNUutils_() { } +_homebrewPath_() { + # DESC: + # Add homebrew bin dir to PATH + # ARGS: + # None + # OUTS: + # 0 if successful + # 1 if unsuccessful + # PATH: Adds homebrew bin directory to PATH + # USAGE: + # # if ! _homebrewPath_; then exit 1; fi + + ! declare -f "_setPATH_" &>/dev/null && fatal "${FUNCNAME[0]} needs function _setPATH_" + + if _setPATH_ "/usr/local/bin" "/opt/homebrew/bin"; then + return 0 + else + return 1 + fi + +} + _parseOptions_() { # DESC: # Iterates through options passed to script and sets variables. Will break -ab into -a -b diff --git a/utilities/misc.bash b/utilities/misc.bash index 974ad3a..382378b 100644 --- a/utilities/misc.bash +++ b/utilities/misc.bash @@ -455,38 +455,38 @@ _spinner_() { case ${SPIN_NUM:-} in 0) _glyph="█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁" ;; - 1) _glyph="██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁" ;; - 2) _glyph="███▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁" ;; - 3) _glyph="████▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁" ;; - 4) _glyph="██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁" ;; + 1) _glyph="█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁" ;; + 2) _glyph="██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁" ;; + 3) _glyph="███▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁" ;; + 4) _glyph="████▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁" ;; 5) _glyph="██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁" ;; - 6) _glyph="███████▁▁▁▁▁▁▁▁▁▁▁▁▁" ;; - 7) _glyph="████████▁▁▁▁▁▁▁▁▁▁▁▁" ;; - 8) _glyph="█████████▁▁▁▁▁▁▁▁▁▁▁" ;; + 6) _glyph="██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁" ;; + 7) _glyph="███████▁▁▁▁▁▁▁▁▁▁▁▁▁" ;; + 8) _glyph="████████▁▁▁▁▁▁▁▁▁▁▁▁" ;; 9) _glyph="█████████▁▁▁▁▁▁▁▁▁▁▁" ;; - 10) _glyph="██████████▁▁▁▁▁▁▁▁▁▁" ;; - 11) _glyph="███████████▁▁▁▁▁▁▁▁▁" ;; - 12) _glyph="█████████████▁▁▁▁▁▁▁" ;; - 13) _glyph="██████████████▁▁▁▁▁▁" ;; + 10) _glyph="█████████▁▁▁▁▁▁▁▁▁▁▁" ;; + 11) _glyph="██████████▁▁▁▁▁▁▁▁▁▁" ;; + 12) _glyph="███████████▁▁▁▁▁▁▁▁▁" ;; + 13) _glyph="█████████████▁▁▁▁▁▁▁" ;; 14) _glyph="██████████████▁▁▁▁▁▁" ;; - 15) _glyph="███████████████▁▁▁▁▁" ;; + 15) _glyph="██████████████▁▁▁▁▁▁" ;; 16) _glyph="███████████████▁▁▁▁▁" ;; 17) _glyph="███████████████▁▁▁▁▁" ;; - 18) _glyph="████████████████▁▁▁▁" ;; - 19) _glyph="█████████████████▁▁▁" ;; + 18) _glyph="███████████████▁▁▁▁▁" ;; + 19) _glyph="████████████████▁▁▁▁" ;; 20) _glyph="█████████████████▁▁▁" ;; - 21) _glyph="██████████████████▁▁" ;; + 21) _glyph="█████████████████▁▁▁" ;; 22) _glyph="██████████████████▁▁" ;; - 23) _glyph="███████████████████▁" ;; + 23) _glyph="██████████████████▁▁" ;; 24) _glyph="███████████████████▁" ;; 25) _glyph="███████████████████▁" ;; - 26) _glyph="████████████████████" ;; + 26) _glyph="███████████████████▁" ;; 27) _glyph="████████████████████" ;; - 28) _glyph="█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁" ;; + 28) _glyph="████████████████████" ;; esac # shellcheck disable=SC2154 - printf "\r${gray}[ info] %s... %s${reset}" "${_message}" "${_glyph}" + printf "\r${gray}[ info] %s %s...${reset}" "${_glyph}" "${_message}" if [[ ${SPIN_NUM} -lt 28 ]]; then ((SPIN_NUM = SPIN_NUM + 1)) else