Sha256: 222457230ec5918eb4823e7f71eac81d0a121cd938df85da72cc0b65ab1123be
Contents?: true
Size: 911 Bytes
Versions: 13
Compression:
Stored size: 911 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::Exporter::Error => e abort(e.to_s) end
Version data entries
13 entries across 13 versions & 1 rubygems