Skip to content

Instantly share code, notes, and snippets.

@colinta
Created May 20, 2016 21:30
Show Gist options
  • Save colinta/2f6ef0daa3df85492edfe9c74cb938ea to your computer and use it in GitHub Desktop.
Save colinta/2f6ef0daa3df85492edfe9c74cb938ea to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
filename = ARGV[0] or exit(0)
i = 1
arg = ARGV[i]
whitelist = []
while arg && arg != '--' do
whitelist << arg
i += 1
arg = ARGV[i]
end
env = File.read(filename)
lines = env.split("\n")
values = lines.map { |l| l.split("=", 2)[1] }
secrets = values.select { |s|
s && !whitelist.find { |w| s == w }
}
puts secrets
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment