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.17.7 share/rbbt_commands/workflow/install
rbbt-util-5.17.6 share/rbbt_commands/workflow/install
rbbt-util-5.17.5 share/rbbt_commands/workflow/install
rbbt-util-5.17.4 share/rbbt_commands/workflow/install
rbbt-util-5.17.3 share/rbbt_commands/workflow/install
rbbt-util-5.17.2 share/rbbt_commands/workflow/install
rbbt-util-5.17.1 share/rbbt_commands/workflow/install
rbbt-util-5.17.0 share/rbbt_commands/workflow/install
rbbt-util-5.16.3 share/rbbt_commands/workflow/install
rbbt-util-5.16.2 share/rbbt_commands/workflow/install
rbbt-util-5.16.1 share/rbbt_commands/workflow/install
rbbt-util-5.16.0 share/rbbt_commands/workflow/install
rbbt-util-5.15.3 share/rbbt_commands/workflow/install
rbbt-util-5.15.2 share/rbbt_commands/workflow/install
rbbt-util-5.15.1 share/rbbt_commands/workflow/install
rbbt-util-5.14.39 share/rbbt_commands/workflow/install
rbbt-util-5.14.38 share/rbbt_commands/workflow/install
rbbt-util-5.14.37 share/rbbt_commands/workflow/install
rbbt-util-5.14.36 share/rbbt_commands/workflow/install
rbbt-util-5.14.35 share/rbbt_commands/workflow/install