Des menus dans votre terminal - retour accueil
git clone git://bebou.netlib.re/zenu
Log | Files | Refs |
commit 8f01d3360bf8c8584d244043a351b577aa536010 parent aa6044a4df77898ae5d556f3e1fa818b184b3c8e Auterice: Marc Chantreux <mc@unistra.fr> Date: Fri, 30 Jun 2023 22:45:21 +0200 FIX: exit if zenu.loop in a non-directory fix an infinite while loop when data are missing Diffstat:
M | zenu.zsh | | | 9 | ++++++++- |
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/zenu.zsh b/zenu.zsh @@ -47,7 +47,14 @@ zenu.loop() { while (( $# )) { case "$1" in (from) zenu_stack=($2) ; shift 2 - ;; (in) zenu_base=$2 ; shift 2 + ;; (in) + [[ -d $2 ]] || { + >&2 echo "$2 isn't a directory" + return -1 + } + zenu_base=$2 + shift 2 + ;; (*) >&2 echo "not a valid key $1"; return 1 esac } while {eval $ZENU_AGAIN} {