Class: Deployand::Command::Init

Inherits:
Deployand::Command show all
Defined in:
lib/deployand/command/init.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(argv) ⇒ Init

Returns a new instance of Init.



23
24
25
26
27
28
# File 'lib/deployand/command/init.rb', line 23

def initialize(argv)
  @project_name = argv.shift_argument
  @template = argv.option('template', 'android')
  @force = argv.flag?('force')
  super
end

Class Method Details

.optionsObject



16
17
18
19
20
21
# File 'lib/deployand/command/init.rb', line 16

def self.options
  [
    ['--template=TEMPLATE', 'Use a specific template (android, flutter, react-native)'],
    ['--force', 'Overwrite existing configuration files']
  ].concat(super)
end

Instance Method Details

#runObject



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/deployand/command/init.rb', line 35

def run
  print_info "Initializing deployand project: #{@project_name}"
  print_info "Using template: #{@template}"
  
  # TODO: Implement project initialization logic
  # - Create deployand.yml configuration file
  # - Set up directory structure
  # - Generate template files based on project type
  
  print_success "Project #{@project_name} initialized successfully!"
  print_info "Next steps:"
  print_info "  1. Configure your Google Play Console credentials"
  print_info "  2. Update deployand.yml with your app details"
  print_info "  3. Run 'deployand build' to build your app"
end

#validate!Object



30
31
32
33
# File 'lib/deployand/command/init.rb', line 30

def validate!
  super
  help! 'A project name is required.' unless @project_name
end