Sha256: 112cef4b896883b21478070da23fd131167dbb0e060e61be3c2a17be2b2748cc
Contents?: true
Size: 733 Bytes
Versions: 20
Compression:
Stored size: 733 Bytes
Contents
require 'buff/shell_out' module Berkshelf module Mixin module Git # Perform a git command. # # @param [String] command # the command to run # @param [Boolean] error # whether to raise error if the command fails # # @raise [String] # the +$stdout+ from the command def git(command, error = true) unless Berkshelf.which('git') || Berkshelf.which('git.exe') raise GitNotInstalled.new end response = Buff::ShellOut.shell_out(%|git #{command}|) if error && !response.success? raise GitCommandError.new(command, cache_path, response.stderr) end response.stdout.strip end end end end
Version data entries
20 entries across 20 versions & 1 rubygems