File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff 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.
150161download () {
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
You can’t perform that action at this time.
0 commit comments