Skip to content

Commit

Permalink
Squashed 'gitstatus/' changes from cd5673b4..d3bc3e34
Browse files Browse the repository at this point in the history
d3bc3e34 work around bugs in curl on cygwin; see #706
61a67c66 print error message from curl/wget before the summary

git-subtree-dir: gitstatus
git-subtree-split: d3bc3e346cc71ee1a29d0c4316449feb3dcb3116
  • Loading branch information
romkatv committed May 11, 2020
1 parent d047ed8 commit 1db7094
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions install
Original file line number Diff line number Diff line change
Expand Up @@ -207,15 +207,17 @@ END
local url="https://github.com/romkatv/gitstatus/releases/download/$version/$file.tar.gz"
local archive="$cache_dir"/"$file".tmp.$$.tar.gz
if command -v curl >/dev/null 2>&1; then
if ! err="$(command curl -fsSLo "$archive" -- "$url" 2>&1)"; then
>&2 echo "[gitstatus] error: failed to download gitstatusd: $url"
# `cd` is a workaround for Cygwin. It cannot handle -o with slashes.
if ! err="$(cd ${ZSH_VERSION:+-q} -- "$cache_dir" 2>&1 &&
command curl -fsSLo "${archive##*/}" -- "$url" 2>&1)"; then
>&2 printf "%s\n" "$err"
>&2 echo "[gitstatus] error: failed to download gitstatusd: $url"
return 1
fi
elif command -v wget >/dev/null 2>&1; then
if ! err="$(command wget -O "$archive" -- "$url" 2>&1)"; then
>&2 echo "[gitstatus] error: failed to download gitstatusd: $url"
>&2 printf "%s\n" "$err"
>&2 echo "[gitstatus] error: failed to download gitstatusd: $url"
return 1
fi
else
Expand Down

0 comments on commit 1db7094

Please sign in to comment.