Class: Everywhere::Commands::Doctor

Inherits:
Dry::CLI::Command
  • Object
show all
Defined in:
lib/everywhere/commands/doctor.rb

Overview

Check that this machine can build native apps. Desktop checks always run; the iOS and Android sections join in when the app's build.targets include such a target, or explicitly via --target ios-* / android-*.

Instance Method Summary collapse

Instance Method Details

#call(root: ".", target: nil) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/everywhere/commands/doctor.rb', line 19

def call(root: ".", target: nil, **)
  ok = true
  ok &= check("rbe-tebako installed") { Shellout.run?("rbe-tebako help > /dev/null 2>&1") }
  ok &= check("cargo installed")    { Shellout.run?("cargo --version > /dev/null 2>&1") }
  ok &= check("homebrew bison")     { !`brew --prefix bison 2>/dev/null`.strip.empty? }

  ok &= ios_checks if ios_wanted?(root, target)
  ok &= android_checks if android_wanted?(root, target)

  puts
  ok ? UI.success("ready to build") : UI.bad("fix the items above (see https://rubyeverywhere.com/docs/diy/requirements)")
  exit(1) unless ok
end