Skip to content

Commit

Permalink
fix dgoss edit return code (#805)
Browse files Browse the repository at this point in the history
Before dgoss edit returned a 1 return code if GOSS_VARS was unset
but the command was valid.
By refactoring the test of GOSS_VARS with the if clause, dgoss edit
command returns the return code of get_docker_file function.

Signed-off-by: Andrea Grillo <andrea.grillo96@live.com>
Co-authored-by: Ahmed Elsabbahy <aelsabbahy@users.noreply.github.com>
  • Loading branch information
andregri and aelsabbahy committed Jun 3, 2023
1 parent 0cae03b commit bbb8ecb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion extras/dgoss/dgoss
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,9 @@ case "$1" in
$CONTAINER_RUNTIME exec -it "$id" sh -c 'cd /goss; PATH="/goss:$PATH" exec sh'
get_docker_file "$id" "/goss/goss.yaml" "${GOSS_FILES_PATH}/${GOSS_FILE:-goss.yaml}"
get_docker_file "$id" "/goss/goss_wait.yaml" "${GOSS_FILES_PATH}/goss_wait.yaml"
[[ ! -z "${GOSS_VARS}" ]] && get_docker_file "$id" "/goss/${GOSS_VARS}" "${GOSS_FILES_PATH}/${GOSS_VARS}"
if [[ ! -z "${GOSS_VARS}" ]]; then
get_docker_file "$id" "/goss/${GOSS_VARS}" "${GOSS_FILES_PATH}/${GOSS_VARS}"
fi
;;
*)
error "$USAGE"
Expand Down

0 comments on commit bbb8ecb

Please sign in to comment.