mirror of
https://github.com/OpenRouterTeam/spawn.git
synced 2026-05-05 23:50:48 +00:00
fix: Check sprite version before reinstalling (#69)
- Modified ensure_sprite_installed() to check if sprite is already installed - When sprite is found, log version and skip installation - Prevents unnecessary reinstalls when sprite CLI is already present Fixes #63 Agent: community-coordinator Co-authored-by: A <6723574+louisgv@users.noreply.github.com> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
6f5d406861
commit
f387428bca
1 changed files with 11 additions and 4 deletions
|
|
@ -15,11 +15,18 @@ SPRITE_CONNECTIVITY_POLL_DELAY=${SPRITE_CONNECTIVITY_POLL_DELAY:-5} # Delay bet
|
|||
|
||||
# Check if sprite CLI is installed, install if not
|
||||
ensure_sprite_installed() {
|
||||
if ! command -v sprite &> /dev/null; then
|
||||
log_warn "Installing sprite CLI..."
|
||||
curl -fsSL https://sprites.dev/install.sh | bash
|
||||
export PATH="${HOME}/.local/bin:${PATH}"
|
||||
if command -v sprite &> /dev/null; then
|
||||
# sprite is already installed, check version
|
||||
local installed_version
|
||||
installed_version=$(sprite version 2>/dev/null | grep -oE 'v[0-9]+\.[0-9]+\.[0-9]+(-rc[0-9]+)?' || echo "unknown")
|
||||
log_info "sprite ${installed_version} already installed, skipping installation"
|
||||
return 0
|
||||
fi
|
||||
|
||||
# sprite not found, install it
|
||||
log_warn "Installing sprite CLI..."
|
||||
curl -fsSL https://sprites.dev/install.sh | bash
|
||||
export PATH="${HOME}/.local/bin:${PATH}"
|
||||
}
|
||||
|
||||
# Check if already authenticated with sprite
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue