From 43460d2f6785176a7f4a16ca3b77408b7ad2451e Mon Sep 17 00:00:00 2001 From: Serge Guzik Date: Thu, 14 Feb 2019 17:33:53 +0200 Subject: [PATCH] feat: Show warning if zip is not available Do not crash trying to create archive for windows if zip is not available, just show warning and continue. --- warp4j | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/warp4j b/warp4j index 8107e4c..00f7ed1 100755 --- a/warp4j +++ b/warp4j @@ -622,11 +622,14 @@ function warp_targets() { --exec "$LAUNCHER_NAME.cmd" \ --output "$WARPED_TEMP_PATH/$WIN/$APP_NAME.exe" \ &> /dev/null - (cd "$WARPED_TEMP_PATH/$WIN" - zip -r "$WARPED_TEMP_PATH/$APP_NAME-$WIN-x64.zip" "$APP_NAME.exe" &> /dev/null - ) mv "$WARPED_TEMP_PATH/$WIN/$APP_NAME.exe" "$WARPED_PATH/$APP_NAME-windows.exe" - mv "$WARPED_TEMP_PATH/$APP_NAME-$WIN-x64.zip" "$WARPED_PATH" + if command -v zip &> /dev/null ; then ( + cd "$WARPED_TEMP_PATH/$WIN" + zip -r "$WARPED_TEMP_PATH/$APP_NAME-$WIN-x64.zip" "$APP_NAME.exe" &> /dev/null + mv "$WARPED_TEMP_PATH/$APP_NAME-$WIN-x64.zip" "$WARPED_PATH" + ) else + echo "Warning: 'zip' not found, will skip creation of archive for windows" >&2 + fi rmdir "$WARPED_TEMP_PATH/$WIN" fi