Sha256: 3098c2360ae52a47f95d96dee174860a946998c9ff69b2dbefb294aa82147860

Contents?: true

Size: 908 Bytes

Versions: 2

Compression:

Stored size: 908 Bytes

Contents

#!/usr/bin/env ruby
require 'shellwords'
now=Time.now.strftime("%Y-%m-%d %H:%M:%S")
if ARGV.empty?
    $stderr.puts "ERROR #{now} [wu                  ] -- Must provide a Wukong command to run. Try the --help option."
else
    if ARGV.size == 1 && ARGV.first == '--help'
	$stderr.puts <<EOF
usage: wu COMMAND [OPTIONS] [ARG] ...

wu is a wrapper for easy use of Wukong's command-line tools.  It takes
your arguments, constructs the name of the proper wu-tool to call, and
prepends a call to bundle exec.

  $ wu local ...

is equivalent to

  $ bundle exec wu-local ...

You can run any of the wu-tools like
	
  wu-local
  wu-hadoop
  wu-deploy

EOF
    else
      if ARGV.first =~ /^-/
        $stderr.puts "ERROR ${now} [wu                  ] -- First argument must be the name of a wu tool to run, got <${1}>"
      else
        Kernel.exec "bundle exec wu-#{Shellwords.join(ARGV)}"
      end
    end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
wukong-deploy-0.1.1 bin/wu
wukong-deploy-0.1.0 bin/wu