mirror of
https://github.com/deadcxap/init_scripts.git
synced 2026-07-02 05:43:40 +03:00
Merge pull request #16 from deadcxap/codex/limit-script-log-output
Скрыть вывод команд в setup.sh
This commit is contained in:
@@ -14,13 +14,15 @@ run() {
|
|||||||
local desc="$1"
|
local desc="$1"
|
||||||
shift
|
shift
|
||||||
log "$desc"
|
log "$desc"
|
||||||
if "$@"; then
|
local output
|
||||||
|
if output=$("$@" 2>&1); then
|
||||||
log "OK: $desc"
|
log "OK: $desc"
|
||||||
SUMMARY+=("$desc: OK")
|
SUMMARY+=("$desc: OK")
|
||||||
else
|
else
|
||||||
local rc=$?
|
local rc=$?
|
||||||
log "ERROR: $desc (code $rc)"
|
log "ERROR: $desc (code $rc)"
|
||||||
SUMMARY+=("$desc: ERROR")
|
SUMMARY+=("$desc: ERROR")
|
||||||
|
echo "$output" >&2
|
||||||
exit $rc
|
exit $rc
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@@ -319,7 +321,7 @@ setup_role() {
|
|||||||
REPO_URL="https://github.com/deadcxap/init_scripts.git"
|
REPO_URL="https://github.com/deadcxap/init_scripts.git"
|
||||||
ROLE_URL="https://api.github.com/repos/deadcxap/init_scripts/contents/$ROLE"
|
ROLE_URL="https://api.github.com/repos/deadcxap/init_scripts/contents/$ROLE"
|
||||||
log "Checking role $ROLE exists in repository"
|
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"
|
log "OK: role $ROLE exists in repository"
|
||||||
SUMMARY+=("Role exists check: OK")
|
SUMMARY+=("Role exists check: OK")
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user