Skip to content

Commit

Permalink
Change bin/automatic's default behavior
Browse files Browse the repository at this point in the history
You will have to give recipe path option,
because previous automatic command execute config/default.yml,
probably, that is almost user unexpected behavior.
  • Loading branch information
Satoshi Namai committed Mar 11, 2012
1 parent 7b9a522 commit 5ccc639
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions bin/automatic
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,22 @@ parser = OptionParser.new { |parser|

begin
parser.parse!
puts "Loading #{recipe_path}" if recipe_path.empty?
puts "Loading #{recipe_path}" unless recipe_path.empty?
rescue OptionParser::ParseError => err
$stderr.puts err.message
$stderr.puts parser.help
exit 1
end

Automatic.run(:recipe => recipe_path,
if recipe_path.to_s.empty?
if ENV["AUTOMATIC_RUBY_ENV"] == "test"
recpie_path = File.join(root_dir, 'config/default.yml')
else
puts parser
exit 0
end
end

recipe = Automatic::Recipe.new(recipe_path)
Automatic.run(:recipe => recipe,
:root_dir => root_dir)

0 comments on commit 5ccc639

Please sign in to comment.