mirror of
https://github.com/OpenRouterTeam/spawn.git
synced 2026-05-06 08:10:48 +00:00
- Add get_resource_name() to shared/common.sh
- Generic function for env-var-or-prompt pattern
- Uses indirect expansion ${!var} for dynamic env vars
- Preserves exact behavior: env check → prompt → error
- Update 9 cloud providers to use shared function:
- aws-lightsail: LIGHTSAIL_SERVER_NAME
- digitalocean: DO_DROPLET_NAME (with validation)
- gcp: GCP_INSTANCE_NAME
- hetzner: HETZNER_SERVER_NAME (with validation)
- linode: LINODE_SERVER_NAME (with validation)
- sprite: SPRITE_NAME (with validation)
- vultr: VULTR_SERVER_NAME (with validation)
- e2b: E2B_SANDBOX_NAME
- modal: MODAL_SANDBOX_NAME
- Reduces code duplication: ~120 lines → ~25 lines
- Maintains backward compatibility (env vars, prompts, errors unchanged)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
||
|---|---|---|
| .. | ||
| common.sh | ||