Class: EtFullSystem::WorkspaceCommand

Inherits:
Thor
  • Object
show all
Defined in:
lib/et_full_system/cli/workspace.rb

Instance Method Summary collapse

Instance Method Details

#checkout(branch_or_commit) ⇒ Object



23
24
25
26
27
28
# File 'lib/et_full_system/cli/workspace.rb', line 23

def checkout(branch_or_commit)
  return say "Please change to a workspace setup by this tool" unless File.exist?(File.join(Dir.pwd, 'et-full-system.dir'))
  puts `git fetch`
  puts `git checkout #{branch_or_commit}`
  puts `git submodule update`
end

#newObject



10
11
12
13
14
# File 'lib/et_full_system/cli/workspace.rb', line 10

def new
  return unless yes?("Are you sure that you want to clone all system repositories for employment tribunals into this directory ?")
  return say "The current directory must be empty" unless Dir.empty?(Dir.pwd)
  puts `git clone --recursive [email protected]:hmcts/et-full-system-servers.git .`
end

#pullObject



17
18
19
20
# File 'lib/et_full_system/cli/workspace.rb', line 17

def pull
  return say "Please change to a workspace setup by this tool" unless File.exist?(File.join(Dir.pwd, 'et-full-system.dir'))
  puts `git pull && git submodule update`
end