Skip to content

Commit

Permalink
Add retries to volta install command
Browse files Browse the repository at this point in the history
  • Loading branch information
felipecrs committed Aug 15, 2024
1 parent a4fc0b0 commit fc59bbc
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ readonly unwanted_packages=(
)

for package in "${unwanted_packages[@]}"; do
# shellcheck disable=SC2310
if is_volta_package_installed "${package}"; then
log_task "Removing unwanted packages with Volta: ${missing_packages[*]}"
volta uninstall "${package}"
Expand All @@ -34,12 +35,16 @@ readonly wanted_packages=(
missing_packages=()

for package in "${wanted_packages[@]}"; do
# shellcheck disable=SC2310
if ! is_volta_package_installed "${package}"; then
missing_packages+=("${package}")
fi
done

if [[ ${#missing_packages[@]} -gt 0 ]]; then
log_task "Installing missing packages with Volta: ${missing_packages[*]}"
volta install "${missing_packages[@]}"
# https://github.com/volta-cli/volta/issues/1523#issuecomment-1701844815
ensure_path_entry "${HOME}/.local/bin"
retry --tries 9 --sleep 15s -- \
volta install "${missing_packages[@]}"
fi

0 comments on commit fc59bbc

Please sign in to comment.