Skip to content

Instantly share code, notes, and snippets.

@fijimunkii
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fijimunkii/9809127 to your computer and use it in GitHub Desktop.
Save fijimunkii/9809127 to your computer and use it in GitHub Desktop.
vagrant: adds latest rbenv to berksfile
repo="fnichol/chef-rbenv"
latest_release=$(curl -s https://api.github.com/repos/$repo/git/refs/tags \
| ruby -rjson -e '
j = JSON.parse(STDIN.read);
puts j.map { |t| t["ref"].split("/").last }.sort.last
')
cat >> Berksfile <<END_OF_BERKSFILE
cookbook 'rbenv',
:git => 'git://github.com/$repo.git', :branch => '$latest_release'
END_OF_BERKSFILE
berks install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment