Skip to content

Instantly share code, notes, and snippets.

@tappleby
tappleby / edit_data_bag.rb
Last active December 16, 2015 04:58 — forked from aaronjensen/edit_data_bag.rb
Edit data bag when using chef solo. Changed to automatically write empty data bag if none exists.
#!/usr/bin/env ruby
Dir.chdir File.join(__FILE__, "../..")
unless ENV['EDITOR']
puts "No EDITOR found. Try:"
puts "export EDITOR=vim"
exit 1
end
unless ARGV.count == 2