Sha256: b180fa098f2f068a32022ae97839159bca7e8c9b7b732e5b9d4e3a01918b6be6

Contents?: true

Size: 532 Bytes

Versions: 1

Compression:

Stored size: 532 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' unles 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.16 lib/meroku/cli/secrets.rb