diff options
Diffstat (limited to 'functions.sh')
| -rw-r--r-- | functions.sh | 21 | 
1 files changed, 14 insertions, 7 deletions
| diff --git a/functions.sh b/functions.sh index a260f66..b343e65 100644 --- a/functions.sh +++ b/functions.sh @@ -18,20 +18,15 @@ download()  export -f download  # Shows a spinner while another command is running. Randomly picks one of 12 spinner styles. -# @args command to run (with any parameters) while showing a spinner.  +# @args command to run (with any parameters) while showing a spinner.  #       E.g. ‹spinner sleep 10› -function shutdown() { -  tput cnorm # reset cursor -} -trap shutdown EXIT -  function cursorBack() {    echo -en "\033[$1D"  }  function spinner() { -  # make sure we use non-unicode character type locale  +  # make sure we use non-unicode character type locale    # (that way it works for any locale as long as the font supports the characters)    local numspinners=12 @@ -114,3 +109,15 @@ function spinner() {    wait "$pid" # capture exit code    return $?  } + +fail() +{ +	printf "%b" "${IRED}${1}${RST}\n" +} +export -f fail + +success() +{ +	printf "%b" "${IGRN}${1}${RST}\n" +} +export -f success | 
