aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorromkatv <roman.perepelitsa@gmail.com>2020-05-11 19:19:51 +0300
committerromkatv <roman.perepelitsa@gmail.com>2020-05-11 19:19:51 +0300
commite27a8fbcbf57bad399e74a78770ca89eb600db64 (patch)
treee7cb736126177ab45028b59671c53e1d0057e5d5
parent1a976f989a7b9ace28ec72a57eb570850088ab8e (diff)
parent1db7094966bc86658166709db26b7750d8fc2821 (diff)
Merge commit '1db7094966bc86658166709db26b7750d8fc2821'
-rwxr-xr-xgitstatus/install8
1 files changed, 5 insertions, 3 deletions
diff --git a/gitstatus/install b/gitstatus/install
index f747015c..1ae8d8dd 100755
--- a/gitstatus/install
+++ b/gitstatus/install
@@ -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