Class: Oncall::Commands::InitCommand

Inherits:
Object
  • Object
show all
Defined in:
lib/oncall/commands/init_command.rb

Class Method Summary collapse

Class Method Details

.invoke(args) ⇒ Object



4
5
6
7
8
9
10
11
12
13
# File 'lib/oncall/commands/init_command.rb', line 4

def self.invoke(args)
  config_template_path = File.join(File.dirname(__FILE__), '..', 'templates', 'oncall.yml.template')
  template = File.read(config_template_path)

  File.open(File.join(Dir.getwd, 'oncall.yml'), 'w') do |file|
    file.write(template)
  end

  exit
end