소스 검색

Return exit code on missing value

Let the site configuration value script return 1 when
the requested value is not available.This enables us
to react on failures, so we can for example use a default
value.

With this patch the script will return with exitcode 1 if
the value is not found and no output on stdout. Otherwise
exitcode is 0 and the value is returned on stdout.
Daniel Ehlers 10 년 전
부모
커밋
bd28aa99ae
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      scripts/site.sh

+ 2 - 1
scripts/site.sh

@@ -2,4 +2,5 @@
 
 export GLUONDIR="$(dirname "$0")/.."
 
-echo "@$1@" | $GLUONDIR/scripts/configure.pl $GLUONDIR/scripts/generate.pl
+RESULT=$(echo "@$1@" | $GLUONDIR/scripts/configure.pl $GLUONDIR/scripts/generate.pl)
+test ! "$RESULT" = "@$1@" && echo $RESULT