Sha256: c5310845363b41a78bb9294e0dcb2148d75392baf0f8cf87b51c0a11775d9883

Contents?: true

Size: 702 Bytes

Versions: 3

Compression:

Stored size: 702 Bytes

Contents

#!/usr/bin/env ruby

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

FileUtils.mkdir_p workflow_dir unless File.exists? workflow_dir

Misc.in_dir(workflow_dir) do
  if File.exists? workflow
    `(cd #{ workflow }; git pull)`
  else
    if repo.nil?
      repo_base_url = Rbbt.etc.workflow_repo.exists? ? Rbbt.etc.workflow_repo.read.strip : 'git@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

3 entries across 3 versions & 1 rubygems

Version Path
rbbt-util-5.5.13 share/rbbt_commands/install/workflow
rbbt-util-5.5.12 share/rbbt_commands/install/workflow
rbbt-util-5.5.11 share/rbbt_commands/install/workflow