diff --git a/setup.sh b/setup.sh index d90fb7c..43327a8 100644 --- a/setup.sh +++ b/setup.sh @@ -14,13 +14,15 @@ run() { local desc="$1" shift log "$desc" - if "$@"; then + local output + if output=$("$@" 2>&1); then log "OK: $desc" SUMMARY+=("$desc: OK") else local rc=$? log "ERROR: $desc (code $rc)" SUMMARY+=("$desc: ERROR") + echo "$output" >&2 exit $rc fi } @@ -306,7 +308,7 @@ setup_role() { REPO_URL="https://github.com/deadcxap/init_scripts.git" ROLE_URL="https://api.github.com/repos/deadcxap/init_scripts/contents/$ROLE" log "Checking role $ROLE exists in repository" - if curl -fsSL -o /dev/null "$ROLE_URL"; then + if curl -fsSL -o /dev/null "$ROLE_URL" 2>/dev/null; then log "OK: role $ROLE exists in repository" SUMMARY+=("Role exists check: OK") else