Skip to content

Instantly share code, notes, and snippets.

<?php
/*
* (C) Copyright 2015 76design Inc (https://76design.com) and others.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
@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