Skip to content

Instantly share code, notes, and snippets.

@chevinbrown
Created May 28, 2020 22:13
Show Gist options
  • Save chevinbrown/9997e901ccaea37aed6bd9291d853a08 to your computer and use it in GitHub Desktop.
Save chevinbrown/9997e901ccaea37aed6bd9291d853a08 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby --disable-gems
require "json"
file = File.read("#{__dir__}/../.env")
JSON.generate(
{
"sections": [
{
"title": "ENVIRONMENT VARIABLES",
"name": "",
"fields":
file.to_s.split("\n").map do |line|
k, v = line.match(/\A(\w+)=(.+)\z/)[1, 2]
{ "k": "concealed", "n": k, "v": v, "t": k }
end
}
]
}
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment