Sha256: 002fe402d93fb917589a0f3905f671449bfd51ce8d1eb5e0fe34a9528bd29295

Contents?: true

Size: 533 Bytes

Versions: 1

Compression:

Stored size: 533 Bytes

Contents

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' unless ENV['SECRET']
        `curl -o ~/.meroku/meroku.env https://s3.amazonaws.com/#{ENV['SECRET']}/meroku.env`
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
meroku-2.0.17 lib/meroku/cli/secrets.rb