From e27e791540a93636a9d6dc38aaf84338d75118b8 Mon Sep 17 00:00:00 2001 From: KwadFan Date: Wed, 16 Dec 2020 22:20:35 +0100 Subject: [PATCH] Fixed Image Name Handling if set in config Signed-off-by: Stephan Wendel --- src/release | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/release b/src/release index 0102af78..80ce8fdf 100755 --- a/src/release +++ b/src/release @@ -32,17 +32,24 @@ if [ "${BASE_RELEASE_IMG_NAME}" == "default" ]; then fi done else - IMG_FILENAME="${BASE_IMG_NAME}" + # Added little cleanout, if someone is stupid like me and adds .img :) + IMG_FILENAME="${BASE_RELEASE_IMG_NAME%.img}.img" fi mv "${FILENAME}" "${IMG_FILENAME}" if [ "${BASE_RELEASE_COMPRESS}" == "yes" ]; then echo "Compressing image" + # Default behavior if no names set if [ "${BASE_RELEASE_IMG_NAME}" == "default" ]; then zip "${IMG_FILENAME::-4}.zip" "${IMG_FILENAME}" else - zip "${BASE_IMG_NAME%.zip}".zip "${IMG_FILENAME}" + # If Zip name not given, rename to given img name + if [ "${BASE_RELEASE_ZIP_NAME}" == "default" ]; then + zip "${BASE_RELEASE_IMG_NAME%.img}".zip "${IMG_FILENAME}" + else + zip "${BASE_RELEASE_ZIP_NAME%.zip}".zip "${IMG_FILENAME}" + fi fi else echo "Not compressing because setting is disabled"