Sha256: ff124824d0729f6c35a5ff42f4b5d0edbf5903436a767991ce8542e712942727
Contents?: true
Size: 832 Bytes
Versions: 3
Compression:
Stored size: 832 Bytes
Contents
module SecretsCli module Vault class Push < SecretsCli::Vault::Base attr_reader :secrets_repo, :secrets_field, :secrets, :secrets_file def initialize(options) super @secrets_repo = options.secrets_repo || config.secrets_repo @secrets_field = options.secrets_field || config.secrets_field @secrets_file = options.secrets_file || config.secrets_file @secrets = File.read(secrets_file) end def call return if !options.without_prompt && !are_you_sure? super end private def command "vault write #{secrets_full_repo} #{secrets_field}=\"#{secrets}\"" end def are_you_sure? prompt.yes?("Are you sure you want to write #{secrets_file} to #{secrets_full_repo}", default: 'Y') end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
secrets_cli-0.2.0 | lib/secrets_cli/vault/push.rb |
secrets_cli-0.1.1 | lib/secrets_cli/vault/push.rb |
secrets_cli-0.1.0 | lib/secrets_cli/vault/push.rb |