Skip to content

Commit 5243b4f

Browse files
committed
Swap curl and wget
Same change was done for `zimfw upgrade`. See zimfw/zimfw#360 `wget` gives some extra output that can be confusing. See https://serverfault.com/q/70889/302338
1 parent 79cbcd0 commit 5243b4f

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

install.zsh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -89,23 +89,23 @@ if [[ -e ${ZSHRC} ]]; then
8989
fi
9090

9191
# Download zimfw script
92-
local -r zscript=${ZIM_HOME}/zimfw.zsh
92+
local -r ztarget=${ZIM_HOME}/zimfw.zsh
9393
if (
9494
command mkdir -p ${ZIM_HOME} || return 1
9595
local -r zurl=https://github.com/zimfw/zimfw/releases/latest/download/zimfw.zsh
96-
if (( ${+commands[wget]} )); then
97-
command wget -nv -O ${zscript} ${zurl} || return 1
98-
elif (( ${+commands[curl]} )); then
99-
command curl -fsSL -o ${zscript} ${zurl} || return 1
96+
if (( ${+commands[curl]} )); then
97+
command curl -fsSL -o ${ztarget} ${zurl} || return 1
98+
elif (( ${+commands[wget]} )); then
99+
command wget -nv -O ${ztarget} ${zurl} || return 1
100100
else
101-
print -u2 -P '%F{red}x Either %Bwget%b or %Bcurl%b are required to download the Zim script.%f'
101+
print -u2 -P '%F{red}x Either %Bcurl%b or %Bwget%b are required to download the Zim script.%f'
102102
return 1
103103
fi
104104
); then
105-
print -PR "%F{green})%f Downloaded the Zim script to %B${zscript}%b"
105+
print -PR "%F{green})%f Downloaded the Zim script to %B${ztarget}%b"
106106
else
107107
command rm -rf ${ZIM_HOME}
108-
print -u2 -PR "%F{red}x Could not download the Zim script to %B${zscript}%b%f"
108+
print -u2 -PR "%F{red}x Could not download the Zim script to %B${ztarget}%b%f"
109109
return 1
110110
fi
111111

src/steps/50_download_script.zsh.erb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
# Download zimfw script
2-
local -r zscript=${ZIM_HOME}/zimfw.zsh
2+
local -r ztarget=${ZIM_HOME}/zimfw.zsh
33
if (
44
command mkdir -p ${ZIM_HOME} || return 1
55
local -r zurl=https://github.com/zimfw/zimfw/releases/latest/download/zimfw.zsh
6-
if (( ${+commands[wget]} )); then
7-
command wget -nv -O ${zscript} ${zurl} || return 1
8-
elif (( ${+commands[curl]} )); then
9-
command curl -fsSL -o ${zscript} ${zurl} || return 1
6+
if (( ${+commands[curl]} )); then
7+
command curl -fsSL -o ${ztarget} ${zurl} || return 1
8+
elif (( ${+commands[wget]} )); then
9+
command wget -nv -O ${ztarget} ${zurl} || return 1
1010
else
11-
print -u2 -P '%F{red}<%= error %>Either %Bwget%b or %Bcurl%b are required to download the Zim script.%f'
11+
print -u2 -P '%F{red}<%= error %>Either %Bcurl%b or %Bwget%b are required to download the Zim script.%f'
1212
return 1
1313
fi
1414
); then
15-
print -PR "<%= okay %>Downloaded the Zim script to %B${zscript}%b"
15+
print -PR "<%= okay %>Downloaded the Zim script to %B${ztarget}%b"
1616
else
1717
command rm -rf ${ZIM_HOME}
18-
print -u2 -PR "%F{red}<%= error %>Could not download the Zim script to %B${zscript}%b%f"
18+
print -u2 -PR "%F{red}<%= error %>Could not download the Zim script to %B${ztarget}%b%f"
1919
return 1
2020
fi

0 commit comments

Comments
 (0)