Added option to specify app_root, if executing a Procfile from a shared location

This commit is contained in:
Nathan Broadbent
2011-12-03 12:20:39 +08:00
parent 39ace26ae1
commit 8bc8cb4b2e
2 changed files with 2 additions and 1 deletions

View File

@@ -7,6 +7,7 @@ require "yaml"
class Foreman::CLI < Thor
class_option :procfile, :type => :string, :aliases => "-f", :desc => "Default: Procfile"
class_option :app_root, :type => :string, :aliases => "-d", :desc => "Default: Procfile directory"
desc "start [PROCESS]", "Start the application, or a specific process"

View File

@@ -21,7 +21,7 @@ class Foreman::Engine
def initialize(procfile, options={})
@procfile = Foreman::Procfile.new(procfile)
@directory = File.expand_path(File.dirname(procfile))
@directory = options[:app_root] || File.expand_path(File.dirname(procfile))
@options = options
@environment = read_environment_files(options[:env])
end