Created
October 4, 2013 22:55
-
-
Save tknerr/6834213 to your computer and use it in GitHub Desktop.
transforms `Berksfile.lock`ed dependencies to `metadata.rb` depends statements
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/ruby | |
require 'json' | |
# parse locked dependencies | |
json = JSON.parse(`berks list -F json`) | |
# transform them to metadata.rb format | |
deps = json['cookbooks'].map { |cb| %Q(depends "#{cb['name']}", "#{cb['version']}") } | |
# output for copy/paste to metadata | |
puts "" | |
puts "copy/paste this into your `metadata.rb`:" | |
puts "" | |
puts deps.join("\n") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment