Skip to content

Commit 0e5ea55

Browse files
committed
wip get download output
1 parent e44e2f5 commit 0e5ea55

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

tasks/install_linux.sh

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,15 +146,26 @@ set_collection_url() {
146146
assigned 'package_url'
147147
}
148148

149+
exec_and_capture() {
150+
local _cmd="$*"
151+
152+
info "Executing: ${_cmd}"
153+
local _result
154+
result=$(${_cmd} 2>&1)
155+
local _status=$?
156+
echo "${result}"
157+
return $_status
158+
}
159+
149160
# Download the given url to the given local file path.
150161
download() {
151162
local _url="$1"
152163
local _file="$2"
153164

154165
if exists 'wget'; then
155-
wget -O "${_file}" "${_url}"
166+
exec_and_capture wget -O "${_file}" "${_url}"
156167
elif exists 'curl'; then
157-
curl -sSL -o "${_file}" "${_url}"
168+
exec_and_capture curl -sSL -o "${_file}" "${_url}"
158169
else
159170
fail "Unable to download ${_url}. Neither wget nor curl are installed."
160171
fi

0 commit comments

Comments
 (0)