Tweak delays

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
This commit is contained in:
Haris Gušić 2021-11-02 17:55:07 +01:00
parent 94d94d19e0
commit 8a5e3c2f85

View File

@ -15,10 +15,6 @@ configure() {
fi
}
# Set a custom prompt (optional)
# prompt() {
# }
# timeout a command but only in demo mode
demo_timeout() {
if mode demo; then
@ -62,7 +58,7 @@ run() {
# This is where the demo/tutorial happens # Command tracker
M "Read cheat sheets"
e cheat tar #
unbuffer timeout 2 cheat tar
demo_timeout 2.5 cheat tar
demo_clear
M "Comes with many cheat sheets preinstalled"
@ -72,37 +68,37 @@ run() {
demo_clear
M "Search for a command"
e cheat -s git #
demo_timeout 1.5 cheat -s git
demo_timeout 2 cheat -s git
demo_clear
M "Organize cheat sheets by tag"
c cheat --tag vcs #
demo_prompt
mode demo && sleep 1
mode demo && sleep 1.5
demo_clear
mkdir .cheat
generate_custom_cheatsheet > .cheat/mycommand
generate_custom_vim_cheatsheet > .cheat/custom_vim
rm .lesshst
M "Local cheat sheets"
e tree -a #
tree -a --noreport
e cheat mycommand #
cheat mycommand
e cheat custom_vim #
cheat custom_vim
demo_prompt
if mode demo; then sleep 1.5; fi
demo_clear
M "Easily edit cheat sheets"
e cheat -e mycommand #
e cheat -e custom_vim #
if mode demo; then
# NOTE: A bit of a hack needed to display the editor
timeout 2 tmux new-session "vim -R .cheat/mycommand" >/dev/null
timeout 2 tmux new-session "vim -R .cheat/custom_vim" >/dev/null
else
cheat -e mycommand
cheat -e custom_vim
fi
demo_clear
@ -111,9 +107,6 @@ run() {
# Demo ends here
if mode demo; then c exit; fi
# But the tutorial can continue beyond here
# TODO...
}
# vim: filetype=sh