Skip to content

Commit cd70057

Browse files
committed
make installer work for zsh
1 parent ff9b6e9 commit cd70057

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

utils/installers/install.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,21 @@
55

66
if [ -z "$BASH_VERSION" ]; then
77
if command -v bash >/dev/null 2>&1; then
8-
if [ -f "$0" ] && [ "$0" != "sh" ]; then
8+
if [ -f "$0" ] && [ "$0" != "sh" ] && [ "$0" != "bash" ]; then
99
exec bash "$0" "$@"
1010
else
1111
tmp_dir=$(mktemp -d 2>/dev/null || mktemp -d -t hf-cli-install)
1212
tmp_script="$tmp_dir/install.sh"
1313
cat >"$tmp_script"
1414
chmod +x "$tmp_script"
1515
bash "$tmp_script" "$@"
16-
status=$?
16+
exit_code=$?
1717
rm -rf "$tmp_dir"
18-
exit $status
18+
exit $exit_code
1919
fi
2020
else
2121
echo "[ERROR] bash is required to run this installer." >&2
22+
echo "[ERROR] Please run: curl -LsSf https://hf.co/cli/install.sh | bash" >&2
2223
exit 1
2324
fi
2425
fi
@@ -299,7 +300,7 @@ install_hf_hub() {
299300
fi
300301

301302
if [ "${HF_CLI_VERBOSE_PIP:-}" != "1" ]; then
302-
log_info "(pip output suppressed; set HF_CLI_VERBOSE_PIP=1 for full logs)"
303+
log_info "pip output suppressed; set HF_CLI_VERBOSE_PIP=1 for full logs"
303304
fi
304305

305306
if [ -n "$extra_pip_args" ]; then

0 commit comments

Comments
 (0)