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.
This commit is contained in:
Serge Guzik 2019-02-14 17:33:53 +02:00
parent 86634f8207
commit 43460d2f67

11
warp4j
View File

@ -622,11 +622,14 @@ function warp_targets() {
--exec "$LAUNCHER_NAME.cmd" \ --exec "$LAUNCHER_NAME.cmd" \
--output "$WARPED_TEMP_PATH/$WIN/$APP_NAME.exe" \ --output "$WARPED_TEMP_PATH/$WIN/$APP_NAME.exe" \
&> /dev/null &> /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/$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" rmdir "$WARPED_TEMP_PATH/$WIN"
fi fi