From 087dd4561c25c2797c58cf818c11c44a798e6940 Mon Sep 17 00:00:00 2001 From: v4n <105587619+v4n00@users.noreply.github.com> Date: Wed, 15 Jan 2025 18:29:19 +0200 Subject: [PATCH] fix: added testing for zip command --- h2mm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/h2mm b/h2mm index 8e31f43..5e99fa3 100755 --- a/h2mm +++ b/h2mm @@ -412,7 +412,12 @@ function mod_export() { exit 0 fi - echo -ne "Zip file will be saved in the ${RED}current directory${NC}. Continue? (Y/n): " + if ! command -v zip &> /dev/null; then + echo -e "${RED}Error${NC}: zip is not installed, please install the package and try again." >&2 + exit 1 + fi + + echo -ne "Zip file will be saved in the current directory ($(pwd)). Continue? (Y/n): " read -r confirm if [[ "$confirm" == "y" || "$confirm" == "Y" || "$confirm" = "" ]]; then OUT_DIR=$(mktemp -d)