Sha256: cd0aaeeaa7992782eb6bc5e4417d553b83959d3805d5a94a88c334870eaea6fd

Contents?: true

Size: 880 Bytes

Versions: 178

Compression:

Stored size: 880 Bytes

Contents

#!/usr/bin/env ruby

require 'rbbt'
require 'rbbt-util'
require 'rbbt/workflow'

workflow = ARGV[0]
repo = ARGV[1]

raise "No workflow specified" if workflow.nil?

workflow_dir = Rbbt.etc.workflow_dir.exists? ? Rbbt.etc.workflow_dir.read.strip : Rbbt.workflows.find(:user)

FileUtils.mkdir_p workflow_dir unless File.exists? workflow_dir

Misc.in_dir(workflow_dir) do
  case
  when File.exists?(Misc.snake_case(workflow))
    Misc.in_dir(Misc.snake_case(workflow)) do
      `git pull`
    end
  when File.exists?(workflow)
    Misc.in_dir(workflow) do
      `git pull`
    end
  else
    if repo.nil?
      repo_base_url = Rbbt.etc.workflow_repo.exists? ? Rbbt.etc.workflow_repo.read.strip : 'https://github.com/Rbbt-Workflows/'
      repo = File.join(repo_base_url, Misc.snake_case(workflow) + '.git')
    end
    Log.warn "Cloning #{ repo }"
    `git clone "#{repo}"`
  end
end

Version data entries

178 entries across 178 versions & 1 rubygems

Version Path
rbbt-util-5.13.29 share/rbbt_commands/workflow/install
rbbt-util-5.13.28 share/rbbt_commands/workflow/install
rbbt-util-5.13.27 share/rbbt_commands/workflow/install
rbbt-util-5.13.26 share/rbbt_commands/workflow/install
rbbt-util-5.13.25 share/rbbt_commands/workflow/install
rbbt-util-5.13.24 share/rbbt_commands/workflow/install
rbbt-util-5.13.23 share/rbbt_commands/workflow/install
rbbt-util-5.13.22 share/rbbt_commands/workflow/install
rbbt-util-5.13.21 share/rbbt_commands/workflow/install
rbbt-util-5.13.20 share/rbbt_commands/workflow/install
rbbt-util-5.13.19 share/rbbt_commands/workflow/install
rbbt-util-5.13.18 share/rbbt_commands/workflow/install
rbbt-util-5.13.17 share/rbbt_commands/workflow/install
rbbt-util-5.13.16 share/rbbt_commands/workflow/install
rbbt-util-5.13.15 share/rbbt_commands/workflow/install
rbbt-util-5.13.14 share/rbbt_commands/workflow/install
rbbt-util-5.13.13 share/rbbt_commands/workflow/install
rbbt-util-5.13.12 share/rbbt_commands/workflow/install
rbbt-util-5.13.11 share/rbbt_commands/workflow/install
rbbt-util-5.13.10 share/rbbt_commands/workflow/install