module JekyllRecker::Shell

Shell

Public Class Methods

run(cmd) click to toggle source
# File lib/jekyll_recker/shell.rb, line 8
    def self.run(cmd)
      out, err, status = Open3.capture3(cmd)
      return out if status.success?

      msg = <<~ERROR
        the command \`#{cmd}\` failed!
        --- exit
        #{status}
        --- stdout
        #{out}
        --- stderr
        #{err}
      ERROR

      raise msg
    end