diff --git a/Makefile b/Makefile index 4933bc2..9c4a475 100644 --- a/Makefile +++ b/Makefile @@ -39,7 +39,7 @@ release: sed -i '' "s/# Version: .*/# Version: $$VERSION/" $(OUTPUT); \ git add $(OUTPUT); \ git commit -m "Release $$VERSION"; \ - git tag -a "$$VERSION" -m "Release $$VERSION" + git tag -a "$$VERSION" -m "Release $$VERSION"; \ @echo "\nRelease complete: \033[32m$$VERSION\033[0m" %: diff --git a/demo/demo.sh b/demo/demo.sh index e4c9f7f..b7086e5 100755 --- a/demo/demo.sh +++ b/demo/demo.sh @@ -1,15 +1,13 @@ #!/usr/bin/env bash -# Import the beddu.sh library # shellcheck disable=SC1091 -source "$(dirname -- "$0")/../build/beddu.sh" +source "$(dirname -- "$0")/../dist/beddu.sh" -# Demo function to showcase the framework demo() { _violet=99 _pink=219 - pen "\n>> $_q <<\n" + hide_cursor line pen $_violet "╔═════════════════════════════════════════════╗" @@ -27,7 +25,7 @@ demo() { line spin $_pink "Loading text formatting..." sleep 1 - spop + spop --keep-cursor-hidden upclear pen $_pink italic "-- Text formatting --" line @@ -39,7 +37,7 @@ demo() { line spin $_pink "Loading basic colors..." sleep 1 - spop + spop --keep-cursor-hidden upclear pen $_pink italic "-- Basic colors --" line @@ -51,14 +49,14 @@ demo() { pen cyan "Cyan text" pen white "White text" pen grey "Grey text" - pen -n black "Black text" + pen -n black "Black text " pen italic "[Black text - might not be visible]" line line spin $_pink "Loading ANSI 256 colors..." sleep 1 - spop + spop --keep-cursor-hidden upclear pen $_pink italic "-- ANSI 256 colors (examples) --" line @@ -70,7 +68,7 @@ demo() { line spin $_pink "Loading combined formatting..." sleep 1 - spop + spop --keep-cursor-hidden upclear pen $_pink italic "-- Combined formatting --" line @@ -88,7 +86,7 @@ demo() { line spin $_pink "Loading output utilities..." sleep 1 - spop + spop --keep-cursor-hidden upclear pen $_pink italic "-- Output utilities --" line @@ -99,7 +97,7 @@ demo() { line spin $_pink "Starting interactive experience..." sleep 1 - spop + spop --keep-cursor-hidden upclear pen $_pink italic "-- Interactive functions --" line diff --git a/src/02.ui/spin.sh b/src/02.ui/spin.sh index 00c263a..27680ec 100644 --- a/src/02.ui/spin.sh +++ b/src/02.ui/spin.sh @@ -46,7 +46,7 @@ spin() { hide_cursor # Use a trap to catch USR1 signal for clean shutdown - trap "show_cursor; exit 0" USR1 + trap "exit 0" USR1 # Print the first frame of the spinner pen -n cyan "${spinner:0:1} " @@ -82,10 +82,11 @@ spop() { # Ensure it's really gone if ps -p "${_spinner_pid}" >/dev/null 2>&1; then kill "${_spinner_pid}" 2>/dev/null - # Manually clean up display, unless asked not to do so - if [[ "$keep_cursor_hidden" == false ]]; then - show_cursor - fi + fi + + # Manually clean up display, unless asked not to do so + if [[ "$keep_cursor_hidden" == false ]]; then + show_cursor fi _spinner_pid=""