Class: EySecrets::Shell

Inherits:
Object
  • Object
show all
Defined in:
lib/ey_secrets/adapters/shell.rb

Defined Under Namespace

Classes: CommandFailed

Class Method Summary collapse

Class Method Details

.execute!(action, options = {}) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/ey_secrets/adapters/shell.rb', line 8

def self.execute!(action, options = {})
  action.commands.each do |command|
    yield(command) if block_given?

    unless options[:dry_run]
      unless system(command)
        raise(CommandFailed, "Error while executing #{command}")
      end
    end
  end
end