Sha256: 84350f86ed8d03f4abe675a70b42c35e12e3c6ce5f4c88a30a4e587ae5c849d6

Contents?: true

Size: 1.04 KB

Versions: 2

Compression:

Stored size: 1.04 KB

Contents

#!/usr/bin/env ruby
$:.unshift(File.join(File.dirname(__FILE__), "..", "lib"))
require "poolparty"
require "poolpartycl"

# # Get the git-style program action
# o = PoolParty::Optioner.new(ARGV) do |opts, optioner|
#   opts.on('-n [name]','--name [name]', 'Binary to run')    { |o| optioner.name o }
#   
#   opts.banner = <<-EOB
#   Usage: cloud <specfile> <action> <options>
#   Cloud actions:
#   #{Binary.list_binaries_for("cloud")}
#   EOB
# end

name = ARGV.shift

# If there was no program action given
if !name || name == "-h" || name == "--help"
  puts "Binary required"
  puts <<-EOB
    Usage: cloud <specfile> <action> <options>
    Cloud actions:
    #{Binary.list_binaries_for("cloud")}
    EOB
  exit
end

program_name = "#{File.basename($0)}-#{name}"
program_location = File.join(Binary.binary_directory, program_name)

command_line = "#{program_location} #{ARGV.join(" ")}"

# Run it from the command-line first
if Binary.available_binaries_for("cloud").include?(name)
  exec "#{command_line}"
else
  puts "Unknown poolparty binary: #{program_name}"
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
auser-poolparty-0.2.15 bin/cloud
auser-poolparty-0.2.9 bin/cloud