Skip to content

Commit 7c88f94

Browse files
authored
feat(scripts): add timeout and retry resilience flags to curl in install_plugin.sh (#718)
1 parent a359932 commit 7c88f94

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

scripts/install_plugin.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ validate_command() {
1818
# Function to detect the latest version from GitHub API
1919
get_latest_version() {
2020
local latest_version
21-
latest_version="$(curl -s "${api_repo}" | grep -oE '"name": "v[^"]+' | cut -d 'v' -f 2)"
21+
latest_version="$(curl --connect-timeout 15 --retry 3 -s "${api_repo}" | grep -oE '"name": "v[^"]+' | cut -d 'v' -f 2)"
2222
echo "$latest_version"
2323
}
2424

@@ -31,7 +31,7 @@ install_plugin() {
3131

3232
# Download the plugin archive
3333
if validate_command "curl"; then
34-
curl --fail -sSL "${plugin_url}" -o "${plugin_filename}"
34+
curl --connect-timeout 15 --retry 3 --fail -sSL "${plugin_url}" -o "${plugin_filename}"
3535
elif validate_command "wget"; then
3636
wget -q "${plugin_url}" -O "${plugin_filename}"
3737
else

0 commit comments

Comments
 (0)