From c1b57b59cf6051dfd78010688f0da034caab8f0e Mon Sep 17 00:00:00 2001 From: David Dollar Date: Tue, 24 Jul 2012 11:18:05 -0400 Subject: [PATCH] put app root in $HOME --- lib/foreman/engine.rb | 5 ++++- lib/foreman/process.rb | 6 ++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/foreman/engine.rb b/lib/foreman/engine.rb index 5b96b91..221b195 100644 --- a/lib/foreman/engine.rb +++ b/lib/foreman/engine.rb @@ -256,7 +256,10 @@ private 1.upto(formation[@names[process]]) do |n| reader, writer = create_pipe begin - pid = process.run(:output => writer, :env => { "PORT" => port_for(process, n).to_s }) + pid = process.run(:output => writer, :env => { + "HOME" => process.cwd, + "PORT" => port_for(process, n).to_s + }) writer.puts "started with pid #{pid}" rescue Errno::ENOENT writer.puts "unknown command: #{process.command}" diff --git a/lib/foreman/process.rb b/lib/foreman/process.rb index fd17928..c395a6d 100644 --- a/lib/foreman/process.rb +++ b/lib/foreman/process.rb @@ -90,8 +90,10 @@ class Foreman::Process !alive? end -private - + # Returns the working directory for this +Process+ + # + # @returns [String] + # def cwd File.expand_path(@options[:cwd] || ".") end