Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,15 @@

set -euo pipefail

# Function to run commands only in debug mode
debug() {
if [[ "${RUNNER_DEBUG:-0}" == "1" ]]; then
"$@" | sed 's/^/DEBUG: /g'
fi
}

# Enable debug mode if RUNNER_DEBUG is 1
[[ "${RUNNER_DEBUG:-0}" == "1" ]] && set -x
debug set -x

# Function to print error and exit
error() {
Expand Down Expand Up @@ -121,10 +128,11 @@ else

if [[ "${ASSET_NAME}" == *.zip ]]; then
info "Extracting ${ASSET_NAME}"
debug unzip -l "${ASSET_NAME}"
unzip -q "${ASSET_NAME}"
elif [[ "${ASSET_NAME}" == *.tar.gz ]]; then
info "Extracting ${ASSET_NAME}"
tar tzf "${ASSET_NAME}"
debug tar tzf "${ASSET_NAME}"
tar xzf "${ASSET_NAME}"
fi

Expand Down