Class: EarlGrey::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/earlgrey/cli.rb

Constant Summary collapse

PROJECT =
'project'.freeze
TARGET =
'target'.freeze
SCHEME =
'scheme'.freeze
SWIFT =
'swift'.freeze
CARTHAGE =
'carthage'.freeze
SWIFT_VERSION =
'swift_version'.freeze

Instance Method Summary collapse

Instance Method Details

#installObject


36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/earlgrey/cli.rb', line 36

def install
  o = options.dup

  opts = { swift: o[SWIFT], carthage: o[CARTHAGE], swift_version: o[SWIFT_VERSION] }

  # Use target as the default Scheme name.
  o[SCHEME] ||= o[TARGET]

  o[PROJECT] ||= Dir.glob(File.join(Dir.pwd, '*.xcodeproj')).first
  raise 'No project found' unless o[PROJECT]

  EarlGrey.configure_for_earlgrey o[PROJECT], o[TARGET], o[SCHEME], opts
end