From 862c94b08344372c70c78af1672967829f78c66f Mon Sep 17 00:00:00 2001 From: Andreas Romeyke <art1@andreas-romeyke.de> Date: Fri, 29 Oct 2021 19:34:50 +0200 Subject: [PATCH] - fixed shellcheck warnings - fixed excludes - minor fixes --- build_release.sh | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/build_release.sh b/build_release.sh index d9f93dd..cb0c76b 100644 --- a/build_release.sh +++ b/build_release.sh @@ -1,5 +1,5 @@ #!/usr/bin/bash -# Release build under Debian 10 +# Release build under Debian 11 DATE="$(date +%F\ %T)" BRANCH="$(git branch --show-current)" @@ -8,16 +8,21 @@ BUILD_ZIP="SLUB_SIP_Builder.version-${VERSION}.zip" BUILD_DIR="build" BUILD_ROOT="${BUILD_DIR}/SLUB_SIP_Builder" BUILD_SCRIPT=$(basename "$0") - -rm -rf ${BUILD_ZIP} -rm -rf ${BUILD_DIR} -mkdir -p ${BUILD_ROOT} +rm -rf "${BUILD_ZIP}" +rm -rf "${BUILD_DIR}" +mkdir -p "${BUILD_ROOT}" rsync -av --exclude='.git' --exclude='.idea' --exclude='_Deparsed_XSubs.pm' \ --exclude='.gitignore' --exclude='tmp' \ --exclude='*.zip' \ - --exclude=${BUILD_SCRIPT} --exclude=${BUILD_DIR}/ ./ ${BUILD_ROOT} + --exclude="${BUILD_SCRIPT}" --exclude="${BUILD_DIR}/" \ + --exclude="*.iml" ./ "${BUILD_ROOT}" sed -i "/^#.*FILE:.*/a \ #\n\ # VERSION: ${VERSION}\n\ # RELEASE DATE: ${DATE}" ${BUILD_ROOT}/bin/slubsipbuilderbagit.pl -cd ${BUILD_DIR}; zip -r ../${BUILD_ZIP} .; cd .. -rm -rf ${BUILD_DIR} \ No newline at end of file +cd "${BUILD_DIR}" ||exit; zip -r ../"${BUILD_ZIP}" .; cd .. +rm -rf "${BUILD_DIR}" +if [[ -e "${BUILD_ZIP}" ]]; then + echo "release archived in file '${BUILD_ZIP}' :)" +else + echo "something goes wrong :(" +fi \ No newline at end of file -- GitLab