Class: Papa::Command::Git::Checkout

Inherits:
Base
  • Object
show all
Defined in:
lib/papa/command/git/checkout.rb

Instance Attribute Summary

Attributes inherited from Base

#command, #exit_status, #silent, #stderr, #stdout

Instance Method Summary collapse

Methods inherited from Base

#cleanup, #failed?, #run, #success?

Constructor Details

#initialize(branch_name) ⇒ Checkout

Returns a new instance of Checkout.



7
8
9
10
11
# File 'lib/papa/command/git/checkout.rb', line 7

def initialize(branch_name)
  @branch_name = branch_name
  command = "git checkout #{@branch_name}"
  super(command)
end

Instance Method Details

#failure_messageObject



13
14
15
16
17
18
# File 'lib/papa/command/git/checkout.rb', line 13

def failure_message
  super
  message = "Failed to checkout #{@branch_name.bold}. Check whether this branch exists."
  Helper::Output.error message
  message
end