Sha256: 418ab4625d85b6b8b688f0ea6489502bce339b0cb4b66b8b23243fd3948a21f0

Contents?: true

Size: 537 Bytes

Versions: 2

Compression:

Stored size: 537 Bytes

Contents

require 'karo/config'
require 'thor'

module Karo

  module Common Thor

    include Thor::Actions

    def make_command(configuration, namespace, command, extras)
      commands = configuration["commands"]

      if commands && commands[namespace] && commands[namespace][command]
        command = commands[namespace][command]
      end

      extras = extras.flatten(1).uniq.join(" ").strip

      "#{command} #{extras}"
    end

    def run_it(cmd, verbose=false)
      say cmd, :green if verbose
      system cmd
    end

  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
karo-2.1.3 lib/karo/common.rb
karo-2.1.2 lib/karo/common.rb