Created
May 28, 2020 22:13
-
-
Save chevinbrown/9997e901ccaea37aed6bd9291d853a08 to your computer and use it in GitHub Desktop.
This file contains 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
#!/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