unoverse 0.1.47 → 0.1.49

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.
@@ -41,7 +41,12 @@ cmd_deploy() {
41
41
  *) cloud=digitalocean ;;
42
42
  esac
43
43
  echo ""
44
- cmd_ground "$([ "$cloud" = "aws" ] && echo aws || echo do)" || exit 1
44
+ cmd_ground "$([ "$cloud" = "aws" ] && echo aws || echo do)" || {
45
+ echo ""
46
+ info "Once that is sorted, run ${BOLD}unoverse deploy${NC} again. It picks up right here."
47
+ echo ""
48
+ exit 1
49
+ }
45
50
  echo ""
46
51
  info "Your $cloud ground is prefilled. Two commands left:"
47
52
  info " cd infra/$cloud && terraform init && terraform apply ${DIM}# creates the server (billable)${NC}"
@@ -18,16 +18,42 @@ _ground_do() {
18
18
  local out="$dir/terraform.tfvars"
19
19
 
20
20
  if ! command -v doctl >/dev/null 2>&1; then
21
- fail "doctl is not installed"
22
- info " brew install doctl (macOS)"
23
- info " https://docs.digitalocean.com/reference/doctl/how-to/install/"
24
- info "Then authenticate: doctl auth init"
25
- return 1
21
+ # Offer to install rather than sending the developer away with homework: brew is
22
+ # already on most Macs that got this far. Their yes, their machine, our command.
23
+ if command -v brew >/dev/null 2>&1; then
24
+ local REPLY
25
+ read -r -p " doctl (the DigitalOcean CLI) is needed. Install it now with brew? [Y/n] " REPLY
26
+ if [[ ! "$REPLY" =~ ^[Nn]$ ]]; then
27
+ brew install doctl || { fail "brew install doctl failed"; return 1; }
28
+ ok "doctl installed"
29
+ else
30
+ fail "doctl is needed to continue"
31
+ info " https://docs.digitalocean.com/reference/doctl/how-to/install/"
32
+ return 1
33
+ fi
34
+ else
35
+ fail "doctl is not installed"
36
+ info " brew install doctl (macOS)"
37
+ info " https://docs.digitalocean.com/reference/doctl/how-to/install/"
38
+ info "Then authenticate: doctl auth init"
39
+ return 1
40
+ fi
26
41
  fi
27
42
  if ! doctl account get >/dev/null 2>&1; then
28
- fail "doctl is not authenticated"
29
- info "Run: doctl auth init (needs a DO API token from cloud.digitalocean.com/account/api)"
30
- return 1
43
+ # Authenticate RIGHT HERE and keep going: doctl auth init is interactive anyway,
44
+ # so there is nothing to leave the flow for. The token comes from
45
+ # cloud.digitalocean.com/account/api (Generate New Token, read and write).
46
+ echo ""
47
+ info "doctl needs a DigitalOcean API token ${DIM}(cloud.digitalocean.com/account/api)${NC}"
48
+ echo ""
49
+ if ! doctl auth init; then
50
+ fail "authentication did not complete"
51
+ return 1
52
+ fi
53
+ if ! doctl account get >/dev/null 2>&1; then
54
+ fail "that token did not authenticate"
55
+ return 1
56
+ fi
31
57
  fi
32
58
  ok "doctl authenticated"
33
59
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "unoverse",
3
- "version": "0.1.47",
3
+ "version": "0.1.49",
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",