From c4ad91e6b94994b3f632fb35c9e8567bbb8334e8 Mon Sep 17 00:00:00 2001 From: Benjamin Marwell Date: Mon, 1 Jun 2020 22:02:13 +0200 Subject: [PATCH] Do not create empty file on error --- apache-maven/src/assembly/wrapper/script/download | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apache-maven/src/assembly/wrapper/script/download b/apache-maven/src/assembly/wrapper/script/download index e2a011c249..79cd110c85 100755 --- a/apache-maven/src/assembly/wrapper/script/download +++ b/apache-maven/src/assembly/wrapper/script/download @@ -30,9 +30,9 @@ else echo "Found wget ... using wget" fi if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then - wget "$jarUrl" -O "$wrapperJarPath" + wget "$jarUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath" else - wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" + wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath" fi elif command -v curl > /dev/null; then if [ "$MVNW_VERBOSE" = true ]; then