Sha256: e47cd788161adb1e257afddcade79cee77bff740d1294f353ab705eca7406e5f

Contents?: true

Size: 1.2 KB

Versions: 7

Compression:

Stored size: 1.2 KB

Contents

module EtFullSystem
  #!/usr/bin/env ruby
  # frozen_string_literal: true
  require "rubygems"
  require "thor"

  class WorkspaceCommand < Thor

    desc "new", "Creates a new workspace in the current directory.  The directory must be empty"
    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 git@github.com:hmcts/et-full-system-servers.git .`
    end

    desc "pull", "Pulls the latest version from the repository and updates the submodules"
    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

    desc "checkout <branch-or-commit>", "Checkout a branch or a specific commit, then updates the submodules"
    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 checkout #{branch_or_commit}`
      puts `git submodule update`
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
et_full_system-0.1.65 lib/et_full_system/cli/workspace.rb
et_full_system-0.1.64 lib/et_full_system/cli/workspace.rb
et_full_system-0.1.63 lib/et_full_system/cli/workspace.rb
et_full_system-0.1.59 lib/et_full_system/cli/workspace.rb
et_full_system-0.1.58 lib/et_full_system/cli/workspace.rb
et_full_system-0.1.57 lib/et_full_system/cli/workspace.rb
et_full_system-0.1.56 lib/et_full_system/cli/workspace.rb