module Bard::CLI::Run

Public Class Methods

included(mod) click to toggle source
# File lib/bard/cli/run.rb, line 4
def self.included mod
  mod.class_eval do

    # HACK: we don't use Thor::Base#run, so its okay to stomp on it here
    original_verbose, $VERBOSE = $VERBOSE, nil
    Thor::THOR_RESERVED_WORDS -= ["run"]
    $VERBOSE = original_verbose

    desc "run <command>", "run the given command on production"
    def run *args
      server = config[:production]
      server.run! *args.join(" "), verbose: true
    rescue Bard::Command::Error => e
      puts red("!!! ") + "Running command failed: #{yellow(e.message)}"
      exit 1
    end

  end
end

Public Instance Methods

run(*args) click to toggle source
# File lib/bard/cli/run.rb, line 13
def run *args
  server = config[:production]
  server.run! *args.join(" "), verbose: true
rescue Bard::Command::Error => e
  puts red("!!! ") + "Running command failed: #{yellow(e.message)}"
  exit 1
end