summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorMarc Cornellà <hello@mcornella.com>2022-02-23 18:44:31 +0100
committerMarc Cornellà <hello@mcornella.com>2022-02-24 13:51:16 +0100
commitff298365626c4366eac930793918c6fbfb8c5d9a (patch)
tree4e68a1d4df9c44075f5d0ca2c8a732d66ba16327 /tools
parent914b6399e88a16fdced427c2ae7738785dcb16b0 (diff)
downloadzsh-ff298365626c4366eac930793918c6fbfb8c5d9a.tar.gz
zsh-ff298365626c4366eac930793918c6fbfb8c5d9a.tar.bz2
zsh-ff298365626c4366eac930793918c6fbfb8c5d9a.zip
fix(updater): timeout after 2s on available update check
Diffstat (limited to 'tools')
-rw-r--r--tools/check_for_upgrade.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/check_for_upgrade.sh b/tools/check_for_upgrade.sh
index a36aecb84..2ad1fca92 100644
--- a/tools/check_for_upgrade.sh
+++ b/tools/check_for_upgrade.sh
@@ -65,11 +65,11 @@ function is_update_available() {
local remote_head
remote_head=$(
if (( ${+commands[curl]} )); then
- curl -fsSL -H 'Accept: application/vnd.github.v3.sha' $api_url 2>/dev/null
+ curl -m 2 -fsSL -H 'Accept: application/vnd.github.v3.sha' $api_url 2>/dev/null
elif (( ${+commands[wget]} )); then
- wget -O- --header='Accept: application/vnd.github.v3.sha' $api_url 2>/dev/null
+ wget -T 2 -O- --header='Accept: application/vnd.github.v3.sha' $api_url 2>/dev/null
elif (( ${+commands[fetch]} )); then
- HTTP_ACCEPT='Accept: application/vnd.github.v3.sha' fetch -o - $api_url 2>/dev/null
+ HTTP_ACCEPT='Accept: application/vnd.github.v3.sha' fetch -T 2 -o - $api_url 2>/dev/null
else
exit 0
fi