mirror of
https://github.com/koenrh/dnscontrol-action.git
synced 2025-01-06 07:12:49 +08:00
Allow for forward any number of arguments and forward the exit code
This commit is contained in:
parent
51da3a98b5
commit
6bcbf9e9eb
1 changed files with 4 additions and 2 deletions
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
set -eo pipefail
|
set -o pipefail
|
||||||
|
|
||||||
# Resolve to full paths
|
# Resolve to full paths
|
||||||
CONFIG_ABS_PATH="$(readlink -f "${INPUT_CONFIG_FILE}")"
|
CONFIG_ABS_PATH="$(readlink -f "${INPUT_CONFIG_FILE}")"
|
||||||
|
@ -10,7 +10,7 @@ WORKING_DIR="$(dirname "${CONFIG_ABS_PATH}")"
|
||||||
cd "$WORKING_DIR"
|
cd "$WORKING_DIR"
|
||||||
|
|
||||||
ARGS=(
|
ARGS=(
|
||||||
"$1"
|
"$@"
|
||||||
--config "$CONFIG_ABS_PATH"
|
--config "$CONFIG_ABS_PATH"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -21,6 +21,7 @@ fi
|
||||||
|
|
||||||
IFS=
|
IFS=
|
||||||
OUTPUT="$(dnscontrol "${ARGS[@]}")"
|
OUTPUT="$(dnscontrol "${ARGS[@]}")"
|
||||||
|
EXIT_CODE="$?"
|
||||||
|
|
||||||
echo "$OUTPUT"
|
echo "$OUTPUT"
|
||||||
|
|
||||||
|
@ -30,3 +31,4 @@ OUTPUT="${OUTPUT//$'\n'/'%0A'}"
|
||||||
OUTPUT="${OUTPUT//$'\r'/'%0D'}"
|
OUTPUT="${OUTPUT//$'\r'/'%0D'}"
|
||||||
|
|
||||||
echo "::set-output name=output::$OUTPUT"
|
echo "::set-output name=output::$OUTPUT"
|
||||||
|
exit $EXIT_CODE
|
||||||
|
|
Loading…
Reference in a new issue