mirror of
https://github.com/natelandau/shell-scripting-templates.git
synced 2025-11-08 13:13:47 -05:00
update spinner output
This commit is contained in:
2
.hooks
2
.hooks
Submodule .hooks updated: af6e81c37d...3c2c0e85ae
@@ -353,28 +353,6 @@ _makeTempDir_() {
|
|||||||
debug "\$TMP_DIR=${TMP_DIR}"
|
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
|
# shellcheck disable=SC2120
|
||||||
_acquireScriptLock_() {
|
_acquireScriptLock_() {
|
||||||
# DESC:
|
# 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_() {
|
_parseOptions_() {
|
||||||
# DESC:
|
# DESC:
|
||||||
# Iterates through options passed to script and sets variables. Will break -ab into -a -b
|
# Iterates through options passed to script and sets variables. Will break -ab into -a -b
|
||||||
|
|||||||
@@ -455,38 +455,38 @@ _spinner_() {
|
|||||||
|
|
||||||
case ${SPIN_NUM:-} in
|
case ${SPIN_NUM:-} in
|
||||||
0) _glyph="█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁" ;;
|
0) _glyph="█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁" ;;
|
||||||
1) _glyph="██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁" ;;
|
1) _glyph="█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁" ;;
|
||||||
2) _glyph="███▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁" ;;
|
2) _glyph="██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁" ;;
|
||||||
3) _glyph="████▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁" ;;
|
3) _glyph="███▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁" ;;
|
||||||
4) _glyph="██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁" ;;
|
4) _glyph="████▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁" ;;
|
||||||
5) _glyph="██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁" ;;
|
5) _glyph="██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁" ;;
|
||||||
6) _glyph="███████▁▁▁▁▁▁▁▁▁▁▁▁▁" ;;
|
6) _glyph="██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁" ;;
|
||||||
7) _glyph="████████▁▁▁▁▁▁▁▁▁▁▁▁" ;;
|
7) _glyph="███████▁▁▁▁▁▁▁▁▁▁▁▁▁" ;;
|
||||||
8) _glyph="█████████▁▁▁▁▁▁▁▁▁▁▁" ;;
|
8) _glyph="████████▁▁▁▁▁▁▁▁▁▁▁▁" ;;
|
||||||
9) _glyph="█████████▁▁▁▁▁▁▁▁▁▁▁" ;;
|
9) _glyph="█████████▁▁▁▁▁▁▁▁▁▁▁" ;;
|
||||||
10) _glyph="██████████▁▁▁▁▁▁▁▁▁▁" ;;
|
10) _glyph="█████████▁▁▁▁▁▁▁▁▁▁▁" ;;
|
||||||
11) _glyph="███████████▁▁▁▁▁▁▁▁▁" ;;
|
11) _glyph="██████████▁▁▁▁▁▁▁▁▁▁" ;;
|
||||||
12) _glyph="█████████████▁▁▁▁▁▁▁" ;;
|
12) _glyph="███████████▁▁▁▁▁▁▁▁▁" ;;
|
||||||
13) _glyph="██████████████▁▁▁▁▁▁" ;;
|
13) _glyph="█████████████▁▁▁▁▁▁▁" ;;
|
||||||
14) _glyph="██████████████▁▁▁▁▁▁" ;;
|
14) _glyph="██████████████▁▁▁▁▁▁" ;;
|
||||||
15) _glyph="███████████████▁▁▁▁▁" ;;
|
15) _glyph="██████████████▁▁▁▁▁▁" ;;
|
||||||
16) _glyph="███████████████▁▁▁▁▁" ;;
|
16) _glyph="███████████████▁▁▁▁▁" ;;
|
||||||
17) _glyph="███████████████▁▁▁▁▁" ;;
|
17) _glyph="███████████████▁▁▁▁▁" ;;
|
||||||
18) _glyph="████████████████▁▁▁▁" ;;
|
18) _glyph="███████████████▁▁▁▁▁" ;;
|
||||||
19) _glyph="█████████████████▁▁▁" ;;
|
19) _glyph="████████████████▁▁▁▁" ;;
|
||||||
20) _glyph="█████████████████▁▁▁" ;;
|
20) _glyph="█████████████████▁▁▁" ;;
|
||||||
21) _glyph="██████████████████▁▁" ;;
|
21) _glyph="█████████████████▁▁▁" ;;
|
||||||
22) _glyph="██████████████████▁▁" ;;
|
22) _glyph="██████████████████▁▁" ;;
|
||||||
23) _glyph="███████████████████▁" ;;
|
23) _glyph="██████████████████▁▁" ;;
|
||||||
24) _glyph="███████████████████▁" ;;
|
24) _glyph="███████████████████▁" ;;
|
||||||
25) _glyph="███████████████████▁" ;;
|
25) _glyph="███████████████████▁" ;;
|
||||||
26) _glyph="████████████████████" ;;
|
26) _glyph="███████████████████▁" ;;
|
||||||
27) _glyph="████████████████████" ;;
|
27) _glyph="████████████████████" ;;
|
||||||
28) _glyph="█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁" ;;
|
28) _glyph="████████████████████" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# shellcheck disable=SC2154
|
# 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
|
if [[ ${SPIN_NUM} -lt 28 ]]; then
|
||||||
((SPIN_NUM = SPIN_NUM + 1))
|
((SPIN_NUM = SPIN_NUM + 1))
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user