Class: T1k::Commands::Hack

Inherits:
Object
  • Object
show all
Defined in:
lib/t1k/commands/hack.rb

Class Method Summary collapse

Class Method Details

.run(path_card_part) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/t1k/commands/hack.rb', line 5

def self.run(path_card_part)
  T1k.setup_credentials
  code_card = "CARD#{T1k::hack path_card_part}"

  system 'git checkout master'
  system 'git pull --rebase origin master'
  existent_branch = `git branch --list #{code_card}`

  if existent_branch.present?
    system "git checkout #{code_card}"
  else
    system "git checkout -b #{code_card}"
  end
end