Files
asterisk/tests/CI/ci.functions
George Joseph 9633e9dfd7 CI: Fix bad reporting of status by the verification pub
Change-Id: I6f31a130b3ba0187149aaaa2ce94195a79e0f6a6
2018-07-16 07:44:25 -06:00

31 lines
448 B
Plaintext

#
# This file contains useful Bash functions
# and can be "source"d from the scripts.
#
declare -a POSITIONAL_ARGS
for a in "$@" ; do
OPTION_COUNT+=1
case "$a" in
--*=*)
[[ $a =~ --([^=]+)=(.*) ]]
l=${BASH_REMATCH[1]//-/_}
r=${BASH_REMATCH[2]}
eval ${l^^}=\"$r\"
;;
--*)
[[ $a =~ --(.+) ]]
l=${BASH_REMATCH[1]//-/_}
eval ${l^^}=1
;;
*)
POSITIONAL_ARGS+=($a)
;;
esac
done
runner() {
( set -x ; ${@} )
}