Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

executable file 39 lines (28 sloc) 0.745 kB
#!/usr/bin/env ruby
require "yaml"
release = YAML.load(STDIN.read) || {}
procs = release["default_process_types"] || {}
procfile = ARGV.first
# read existing procfile
if File.exists?(procfile)
existing = File.read(procfile).split("\n").map do |line|
if line =~ /^([A-Za-z0-9_]+):\s*(.+)$/
[$1, $2]
end
end.compact
else
existing = []
end
existing_names = existing.map(&:first)
procs.each do |name, command|
existing << [name, command] unless existing_names.include?(name)
end
File.open(procfile, "w") do |file|
# write procs out to file
existing.each do |name, command|
# skip unnecessary processes
next if name == "rake"
next if name == "console"
file.puts "#{name}: #{command}"
end
end
Jump to Line
Something went wrong with that request. Please try again.