Sha256: 2e9d5ea58af44b8cc99eae1aba70f37143435470cefdfd409d14670991b1c6bd

Contents?: true

Size: 449 Bytes

Versions: 3

Compression:

Stored size: 449 Bytes

Contents

module Koine
  module DbBkp
    class Cli
      CommandFailed = Class.new(StandardError)

      def execute(command)
        exit_code = system_command(command).to_i

        unless exit_code == 0
          raise CommandFailed, "Command '#{command}' exited with code #{exit_code}"
        end
      end

      def system_command(command)
        puts command
        system(command.to_s)
        $CHILD_STATUS.exitstatus
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
koine-db_bkp-0.1.4 lib/koine/db_bkp/cli.rb
koine-db_bkp-0.1.3 lib/koine/db_bkp/cli.rb
koine-db_bkp-0.1.2 lib/koine/db_bkp/cli.rb