Class: Supply::CommandsGenerator

Inherits:
Object
  • Object
show all
Includes:
Commander::Methods
Defined in:
lib/supply/commands_generator.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.startObject



13
14
15
16
17
18
# File 'lib/supply/commands_generator.rb', line 13

def self.start
  FastlaneCore::UpdateChecker.start_looking_for_update("supply")
  new.run
ensure
  FastlaneCore::UpdateChecker.show_update_status("supply", Supply::VERSION)
end

Instance Method Details

#load_supplyfileObject



60
61
62
# File 'lib/supply/commands_generator.rb', line 60

def load_supplyfile
  Supply.config.load_configuration_file('Supplyfile')
end

#runObject



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/supply/commands_generator.rb', line 20

def run
  program :version, Supply::VERSION
  program :description, Supply::DESCRIPTION
  program :help, 'Author', 'Felix Krause <[email protected]>'
  program :help, 'Website', 'https://fastlane.tools'
  program :help, 'GitHub', 'https://github.com/fastlane/fastlane/tree/master/supply'
  program :help_formatter, :compact

  always_trace!

  global_option('--verbose') { $verbose = true }

  command :run do |c|
    c.syntax = 'supply'
    c.description = 'Run a deploy process'
    c.action do |args, options|
      Supply.config = FastlaneCore::Configuration.create(Supply::Options.available_options, options.__hash__)
      load_supplyfile

      Supply::Uploader.new.perform_upload
    end
  end

  command :init do |c|
    c.syntax = 'supply init'
    c.description = 'Sets up supply for you'
    c.action do |args, options|
      require 'supply/setup'
      Supply.config = FastlaneCore::Configuration.create(Supply::Options.available_options, options.__hash__)
      load_supplyfile

      Supply::Setup.new.perform_download
    end
  end

  default_command :run

  run!
end