mirror of
https://github.com/dokku/dokku.git
synced 2025-12-29 00:25:08 +01:00
Suppress output unless the git submodule update call fails
This will give a bit more warning to developers as to what might be going on, allowing them to respond appropriately. Closes #2479
This commit is contained in:
@@ -28,7 +28,7 @@ git_build_app_repo() {
|
||||
git remote add origin "$DOKKU_ROOT/$APP" &> /dev/null
|
||||
git fetch --depth=1 origin "refs/tags/$TMP_TAG" &> /dev/null
|
||||
git reset --hard FETCH_HEAD &> /dev/null
|
||||
git submodule update --init --recursive &> /dev/null
|
||||
suppress_output git submodule update --init --recursive
|
||||
GIT_DIR="$DOKKU_ROOT/$APP" git tag -d "$TMP_TAG" &> /dev/null || true
|
||||
find -name .git -prune -exec rm -rf {} \; > /dev/null
|
||||
|
||||
@@ -41,6 +41,21 @@ git_build_app_repo() {
|
||||
fi
|
||||
}
|
||||
|
||||
suppress_output() {
|
||||
declare desc="suppress all output from a given command unless there is an error"
|
||||
local TMP_COMMAND_OUTPUT
|
||||
TMP_COMMAND_OUTPUT=$(mktemp "/tmp/${FUNCNAME[0]}.XXXX")
|
||||
trap 'rm -rf "$TMP_COMMAND_OUTPUT" > /dev/null' RETURN INT TERM EXIT
|
||||
|
||||
$* 2>&1 > "$TMP_COMMAND_OUTPUT" || {
|
||||
local exit_code="$?"
|
||||
cat "$TMP_COMMAND_OUTPUT"
|
||||
return "$exit_code"
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
git_hook_cmd() {
|
||||
declare desc="kick off receive-app trigger from git prereceive hook"
|
||||
local cmd="git-hook"
|
||||
|
||||
Reference in New Issue
Block a user