Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion infra/scripts/ide/shell.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ clone https://github.com/zsh-users/zsh-syntax-highlighting ~/.oh-my-zsh/custom/p

log_info "Installing fzf..."
clone https://github.com/junegunn/fzf.git ~/.fzf
~/.fzf/install --all --no-bash --no-fish >/dev/null
retry_command 5 5 LOG "fzf binary" "~/.fzf/install --all --no-bash --no-fish >/dev/null" \
|| echo "⚠ fzf not installed (the terminal works without it)"

log_info "Creating .zshrc..."
cat > ~/.zshrc << 'EOF'
Expand Down
2 changes: 1 addition & 1 deletion infra/scripts/ide/tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ install_java() {
install_nodejs() {
log_info "Installing Node.js ${NODE_VERSION} and tools..."
retry_critical "NVM ${NVM_VERSION}" \
"curl -sS -o- https://raw.githubusercontent.com/nvm-sh/nvm/v${NVM_VERSION}/install.sh | bash"
"rm -rf \"\$HOME/.nvm\" && curl -fsSL https://raw.githubusercontent.com/nvm-sh/nvm/v${NVM_VERSION}/install.sh -o /tmp/nvm-install.sh && bash /tmp/nvm-install.sh && [ -s \"\$HOME/.nvm/nvm.sh\" ]"

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
Expand Down
6 changes: 4 additions & 2 deletions infra/scripts/lib/retry.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/bin/bash
# retry_command <attempts> <delay-seconds> <FAIL|LOG> <name> <cmd...>
# Runs cmd (joined and eval'd, so it may hold redirections) until it succeeds, waiting
# delay seconds between attempts. After the last failed attempt FAIL exits 1, LOG returns 1.
# Runs cmd (joined and eval'd, so it may hold redirections) until it succeeds. The wait
# starts at delay seconds and doubles after each failed attempt (5 s: 5, 10, 20, 40).
# After the last failed attempt FAIL exits 1, LOG returns 1.
# Sourcing this file only defines the function.

retry_command() {
Expand All @@ -22,6 +23,7 @@ retry_command() {
if [ $attempt -lt $max_attempts ]; then
echo "Waiting ${delay}s before retry..."
sleep $delay
delay=$((delay * 2))
fi
done

Expand Down
Loading