def run(args)
$: << File.expand_path(File.join(File.dirname(__FILE__), "..", "lib"))
extracted_args = options(args)
ok = true
if @settings.package_type.nil?
$stderr.puts "Missing package target type (no -t flag?)"
ok = false
end
if @settings.source_type.nil?
$stderr.puts "Missing package source type (no -s flag?)"
ok = false
end
paths = process_paths(extracted_args)
ok = false if paths == :errors
if !ok
$stderr.puts "There were errors; see above."
$stderr.puts
$stderr.puts @help
return 1
end
builder = FPM::Builder.new(@settings, paths)
builder.assemble!
puts "Created #{builder.output}"
return 0
end