Sha256: eeb149dbae6320b9399f34d59833f836032c40486780d795f4facfeed091359b

Contents?: true

Size: 617 Bytes

Versions: 3

Compression:

Stored size: 617 Bytes

Contents

require "bard/command"

module Bard::CLI::Run
  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, verbose: true
      rescue Bard::Command::Error => e
        puts red("!!! ") + "Running command failed: #{yellow(e.message)}"
        exit 1
      end

    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
bard-1.0.4 lib/bard/cli/run.rb
bard-1.0.3 lib/bard/cli/run.rb
bard-1.0.2 lib/bard/cli/run.rb