Sha256: ce0c4d41de500cb3663999629bc0a25d4d173cc83040a9a5277336e9d53058cf

Contents?: true

Size: 734 Bytes

Versions: 36

Compression:

Stored size: 734 Bytes

Contents

module Ufo::Utils
  module Execute
    def execute(command, options={})
      log = options[:log]
      if log
        command += " >> #{log}"
        logger.info "=> #{command}"
        FileUtils.mkdir_p(File.dirname(log))
        File.open(log, 'a') { |f| f.puts "=> #{command}" }
        out = `#{command}`
        success = $?.success?
        unless success
          logger.error out
          exit 1
        end
        out
      else
        logger.info "=> #{command}"
        system(command)
      end
    end

    # TODO: remove these other metohds
    # Custom user params from .ufo/params.yml
    # Param keys are symbols for the aws-sdk calls.
    def user_params
      @user_params ||= Param.new.data
    end
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
ufo-6.3.13 lib/ufo/utils/execute.rb
ufo-6.3.12 lib/ufo/utils/execute.rb
ufo-6.3.11 lib/ufo/utils/execute.rb
ufo-6.3.10 lib/ufo/utils/execute.rb
ufo-6.3.9 lib/ufo/utils/execute.rb
ufo-6.3.8 lib/ufo/utils/execute.rb
ufo-6.3.7 lib/ufo/utils/execute.rb
ufo-6.3.6 lib/ufo/utils/execute.rb
ufo-6.3.5 lib/ufo/utils/execute.rb
ufo-6.3.4 lib/ufo/utils/execute.rb
ufo-6.3.3 lib/ufo/utils/execute.rb
ufo-6.3.2 lib/ufo/utils/execute.rb
ufo-6.3.1 lib/ufo/utils/execute.rb
ufo-6.3.0 lib/ufo/utils/execute.rb
ufo-6.2.5 lib/ufo/utils/execute.rb
ufo-6.2.4 lib/ufo/utils/execute.rb
ufo-6.2.3 lib/ufo/utils/execute.rb
ufo-6.2.2 lib/ufo/utils/execute.rb
ufo-6.2.1 lib/ufo/utils/execute.rb
ufo-6.2.0 lib/ufo/utils/execute.rb