Permalink
Browse files

added --force option to install to allow non-interactive mode

  • Loading branch information...
1 parent 499f8e7 commit 07b1f3f86a2bf4f938df51596e5fa33de4f0c920 Byron K. Appelt committed with josevalim Nov 4, 2009
Showing with 4 additions and 2 deletions.
  1. +4 −2 lib/thor/runner.rb
View
@@ -32,7 +32,7 @@ def method_missing(meth, *args)
end
desc "install NAME", "Install an optionally named Thor file into your system tasks"
- method_options :as => :string, :relative => :boolean
+ method_options :as => :string, :relative => :boolean, :force => :boolean
def install(name)
initialize_thorfiles
@@ -55,7 +55,9 @@ def install(name)
say "Your Thorfile contains:"
say contents
- return false if no?("Do you wish to continue [y/N]?")
+ unless options["force"]
+ return false if no?("Do you wish to continue [y/N]?")
+ end
as = options["as"] || begin
first_line = contents.split("\n")[0]

0 comments on commit 07b1f3f

Please sign in to comment.