Sha256: 6205676398840f189546dd02eae310fe33ccc1ba1a9ad72e356205a2384e8243

Contents?: true

Size: 907 Bytes

Versions: 5

Compression:

Stored size: 907 Bytes

Contents

#!/usr/bin/env ruby
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '../lib/'))

require 'upstart-exporter'
require 'optparse'
require 'fileutils'
require 'yaml'

USAGE = "Usage: upstart-export -p PROCFILE -n APPNAME\nor upstart-export -c -n APPNAME "
options = {}

OptionParser.new do |opts|

  opts.on("-p", "--procfile PROCFILE", "Procfile to export") do |p|
    options[:procfile] = p
  end

  opts.on("-n", "--appname NAME", "Application name") do |n|
    options[:app_name] = n
  end

  opts.on("-c", "--clear", "Remove application scripts") do |n|
    options[:clear] = true
  end
end.parse!

abort(USAGE) if !options[:app_name] || (!options[:procfile] && !options[:clear]) || (options[:procfile] && options[:clear])


begin
  if options[:clear]
    Upstart::Exporter.new(options).clear
  else
    Upstart::Exporter.new(options).export
  end
rescue Upstart::ExportError => e
  abort(e.to_s)
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
upstart-exporter-0.0.6 bin/upstart-export
upstart-exporter-0.0.5 bin/upstart-export
upstart-exporter-0.0.4 bin/upstart-export
upstart-exporter-0.0.3 bin/upstart-export
upstart-exporter-0.0.2 bin/upstart-export