unoverse 0.1.96 → 0.1.97

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -541,13 +541,30 @@ cmd_deploy() {
541
541
  # ── ONE FLOW ────────────────────────────────────────────────────────────────
542
542
  # Which ground, is it configured, plan it, apply it, ship it. In that order, every
543
543
  # time, whether this is the first deploy or the fiftieth.
544
- # A named ground wins; one configured ground is implied; two without a name is refused
545
- # (see _pick_ground). Nothing configured at all falls through to creating one below,
546
- # which is the first-run path and the only case where an empty answer is not a mistake.
547
- local cloud="" rc have=0
548
- [ -f "$ROOT/infra/digitalocean/terraform.tfvars" ] || [ -f "$ROOT/infra/aws/terraform.tfvars" ] && have=1
549
- if [ "$have" = "1" ]; then
550
- cloud=$(SELF_CMD="unoverse deploy" _pick_ground "${GROUND_ARG:-}") || exit 1
544
+ # NAMING A GROUND THAT DOES NOT EXIST YET MEANS BUILD IT THERE. `unoverse deploy aws` on a
545
+ # universe with only a DigitalOcean ground used to answer "No aws ground here. Run
546
+ # unoverse deploy aws to create one" the command just typed, refusing itself. Those
547
+ # words already say where this should go, so the only thing left to do is set it up.
548
+ #
549
+ # A named ground with no tfvars falls through to the create flow below and skips the
550
+ # "which cloud?" question, because it has been answered. An UNNAMED deploy still goes
551
+ # through _pick_ground, which refuses to guess between two configured grounds.
552
+ local cloud="" rc
553
+ case "${GROUND_ARG:-}" in
554
+ do|digitalocean) cloud="digitalocean" ;;
555
+ aws|amazon) cloud="aws" ;;
556
+ esac
557
+
558
+ if [ -n "$cloud" ]; then
559
+ # Named. Configured already? Then use it; otherwise create it below.
560
+ [ -f "$ROOT/infra/$cloud/terraform.tfvars" ] || { cmd_ground "$([ "$cloud" = "aws" ] && echo aws || echo do)" || {
561
+ echo ""
562
+ info "Once that is sorted, run ${BOLD}unoverse deploy $cloud${NC} again. It picks up right here."
563
+ echo ""
564
+ exit 1
565
+ }; }
566
+ elif [ -f "$ROOT/infra/digitalocean/terraform.tfvars" ] || [ -f "$ROOT/infra/aws/terraform.tfvars" ]; then
567
+ cloud=$(SELF_CMD="unoverse deploy" _pick_ground "") || exit 1
551
568
  fi
552
569
 
553
570
  if [ -z "$cloud" ]; then
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "unoverse",
3
- "version": "0.1.96",
3
+ "version": "0.1.97",
4
4
  "description": "The Unoverse front door — create a Studio project, a universe, or a client app, and launch Studio.",
5
5
  "license": "SEE LICENSE IN README.md",
6
6
  "type": "module",