Sha256: a4a5b84186841756945d0279c97ac85e4d7f3edff93837651437beb99ffdbe10

Contents?: true

Size: 488 Bytes

Versions: 11

Compression:

Stored size: 488 Bytes

Contents

module OpenStax::Aws
  module System

    def self.call(command, logger: nil, dry_run:)
      logger&.info("**** DRY RUN ****") if dry_run
      logger&.info("Running: #{command}")

      if !dry_run
        Open3.popen2e(command) do |stdin, stdout_err, wait_thr|
          while line=stdout_err.gets do
            STDERR.puts(line)
          end

          exit_status = wait_thr.value.exitstatus
          exit(exit_status) if exit_status != 0
        end
      end
    end

  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
openstax_aws-2.1.0 lib/openstax/aws/system.rb
openstax_aws-2.0.1 lib/openstax/aws/system.rb
openstax_aws-2.0.0 lib/openstax/aws/system.rb
openstax_aws-1.6.1 lib/openstax/aws/system.rb
openstax_aws-1.6.0 lib/openstax/aws/system.rb
openstax_aws-1.5.0 lib/openstax/aws/system.rb
openstax_aws-1.4.0 lib/openstax/aws/system.rb
openstax_aws-1.3.0 lib/openstax/aws/system.rb
openstax_aws-1.2.0 lib/openstax/aws/system.rb
openstax_aws-1.1.0 lib/openstax/aws/system.rb
openstax_aws-1.0.0 lib/openstax/aws/system.rb