module Meroku module CLI # Logic related to apiusername, apipassword and the env file module Secrets def self.load(admin: false) return unless admin env_file = Dir.home + '/.meroku/meroku.env' attempt_download unless File.exist?(env_file) Dotenv.load(env_file) end def self.attempt_download abort 'ENV["SECRET"] not found' unles ENV['SECRET'] `curl -o ~/.meroku/meroku.env https://s3.amazonaws.com/#{ENV['SECRET']}/meroku.env` end end end end