Skip to content

Instantly share code, notes, and snippets.

@peteoleary
Last active October 18, 2020 15:48
Show Gist options
  • Save peteoleary/64d9a3460f496bca371a00bd6883411b to your computer and use it in GitHub Desktop.
Save peteoleary/64d9a3460f496bca371a00bd6883411b to your computer and use it in GitHub Desktop.
Converts output of 'heroku config' to separate files in /tmp/env directoru
regex = /([0-9A-Z\_]+)\:\s*(.*)/
ARGF.each do |line|
match_data = regex.match line
if match_data
File.write("./env/" + match_data[1], match_data[2], mode: "w")
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment