all repos — shlide @ 922a65e130c9506c27c0de61c4c5344097df2fe6

slide deck presentation tool written in pure bash

Fix $i < 0

Signed-off-by: Anirudh Oppiliappan <x@icyphox.sh>
Anirudh Oppiliappan x@icyphox.sh
Sun, 02 Feb 2020 19:39:58 +0530
commit

922a65e130c9506c27c0de61c4c5344097df2fe6

parent

7b3b37e9c7f40691b848eea29e1e6e61c870b83f

1 files changed, 8 insertions(+), 3 deletions(-)

jump to
M shlideshlide

@@ -66,10 +66,15 @@ slides_dir="${1:-./}"

slides=("$slides_dir"/[0-9]*.txt) i=0 while true; do - if [ "$i" -gt "$((${#slides[@]} - 1))" ]; then + + # Exit after last slide. + [[ "$i" -gt "$((${#slides[@]} - 1))" ]] && { printf '\e[?25h' - exit; - fi + exit + } + + # Don't go below 0. + [[ "$i" -lt 0 ]] && i=0 # Navigate on j/k/n/p and quit on q. display "$(<${slides[$i]})" "${slides[$i]}"