schubergphilis / knife-github

Chef knife plugin to interact with the github enterprise appliance
Other
2 stars 4 forks source link

Yes to all questions option #10

Open isoutham opened 10 years ago

isoutham commented 10 years ago

In deploy

sbotman commented 10 years ago

Ian, this might help you. Within the knife cs plugin, they used the following function.

def confirm_action(question)
  return true if locate_config_value(:yes)
  result = ui.ask_question(question, :default => "Y" )
  if result == "Y" || result == "y" then
    return true
  else
    return false
  end
end

So within the ui object you will find the ask method which you might want to reuse for this. And I believe the config[:yes] is inherited by knife, so no need to do something extra for that (if I remember well ;)