Skip to content

Commit

Permalink
Add better checking of solo.rb exist; stdout spacing added.
Browse files Browse the repository at this point in the history
  • Loading branch information
flaccid committed Oct 31, 2011
1 parent 30c9e60 commit 52da002
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions bin/cs.rb
Expand Up @@ -32,6 +32,7 @@
attributes = Hash.new

# ensure a solo.rb exists for run
puts
solo = false
if File.file?('/etc/chef/solo.rb')
solo = '/etc/chef/solo.rb'
Expand All @@ -43,9 +44,14 @@
else
puts '~/solo.rb: not found.' unless !opts.debug
end
exit 1 unless solo
puts 'Using #{solo}.' unless !opts.debug
puts File.new(solo, 'r').read unless !opts.debug
unless solo
puts 'No solo.rb file found.'
exit 1
else
puts "==> Using #{solo}." unless !opts.debug
puts File.new(solo, 'r').read unless !opts.debug
end
puts

# assign json
if opts.json
Expand Down

0 comments on commit 52da002

Please sign in to comment.