Class: Patcmd::Commands::Add

Inherits:
Base
  • Object
show all
Defined in:
lib/patcmd/commands/add.rb

Instance Method Summary collapse

Instance Method Details

#execute(name) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
# File 'lib/patcmd/commands/add.rb', line 15

def execute(name)
  new_task = {
    "description" => options[:description] || "",
    "group" => options[:group] || "default",
    "command" => options[:command],
    "args" => options[:args],
    "env" => options[:env],
  }
  Configuration.add_task(name, new_task)
  say("Task '#{name}' added successfully.", :green)
end