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"
|
||||
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
|
||||
}
|
||||
@@ -319,7 +321,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
|
||||
|
||||
Reference in New Issue
Block a user