From: xf0r3m Date: Sat, 25 Apr 2026 15:12:31 +0000 (+0200) Subject: Wykonanie instrukcji shift, tylko wtedy gdy występuje argument. Dodanie warunku pod... X-Git-Url: https://gitweb.morketsmerke.org/?a=commitdiff_plain;h=e54cd30d88e61c0b8b72ff448bd0f67ae5d0a9fa;p=immudex.git Wykonanie instrukcji shift, tylko wtedy gdy występuje argument. Dodanie warunku pod którym będzie dodawany custom log. --- diff --git a/immudex-build b/immudex-build index 73ce379..c033f8d 100755 --- a/immudex-build +++ b/immudex-build @@ -46,10 +46,8 @@ case $1 in esac shift; -if [ "$1" ]; then export cname=$1; fi -shift; -if [ "$1" ]; then export version=$1; fi -shift; +if [ "$1" ]; then export cname=$1; shift; fi +if [ "$1" ]; then export version=$1; shift; fi if [ ! -f /sbin/debootstrap ]; then create_enviroment @@ -143,8 +141,10 @@ export arch2=$(echo $archArg | sed 's/-//g'); echo "-==Setting changelog file for this image: $(date)==-" >> immudex_build.log; echo -n "Setting changelog file for this image..."; (source ${HOME}/immudex/versions/template.sh; make_changelog_file $arch2;) -echo "-== User custom changelog ==-" >> $FILE; -echo "${version}: ${@};" >> $FILE; +if [ $# -gt 0 ]; then + echo "-== User custom changelog ==-" >> $FILE; + echo "${version}: ${@};" >> $FILE; +fi if [ $? -eq 0 ]; then echo -e "[ ${GREEN}OK${ENDCOLOR} ]"; fi eval $(grep '^COMMIT' $FILE);