Sha256: 852dd5ea1c6976e70ef8b9e3b6a1c17d519b90285907fa73a9ba94ebf364bcaa

Contents?: true

Size: 927 Bytes

Versions: 1

Compression:

Stored size: 927 Bytes

Contents

#!/usr/bin/env ruby

require 'hitcher'
require 'colorize'
require_relative '../lib/hitcher/global'

# 
# Hitcher run
#

global = Hitcher::Global.instance
cs = File.join(Dir.getwd, global.config.spec_filename)

if File.exist?(cs)
 
  cli = Hitcher::Cli.new
  inst = cli.parse(cs)

  if ARGV.length > 0

    cmd = ARGV[0]
    case cmd
    when "run","r"
      cli.run(inst)
    when "run_prompt","rp"
      cli.run_prompt(inst)
    when "run_new_prompt", "rnp"
      cli.run_new_prompt(inst)
    when "-v"
      STDOUT.puts "Hitcher version #{Hitcher::VERSION}"
    else
      STDERR.puts "Unsupported command '#{cmd}'".red      
      exit(-1)
    end

  else
    STDOUT.puts "Hitcher version #{Hitcher::VERSION}"
    STDOUT.puts "> Hitcher < run | r | run_prompt | rp | run_new_prompt | rnp >"
    exit(-1)
  end

else
  STDERR.puts "cspec not found. Please provide one at #{Dir.getwd} or pass in as parameter"
  exit(-1)
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
Hitcher-0.1.0 exe/hitcher