use a forked process to exec a run with environment
This commit is contained in:
1 parent
497b5ea1eb
commit
612eae5e21
1 file changed
+5
-2
+5
-2
@@ -75,15 +75,18 @@ class Foreman::CLI < Thor
|
|||||||
|
|
||||||
def run(*args)
|
def run(*args)
|
||||||
load_environment!
|
load_environment!
|
||||||
|
pid = fork do
|
||||||
begin
|
begin
|
||||||
process = Foreman::Process.new(args.shelljoin, :env => engine.env)
|
engine.env.each { |k,v| ENV[k] = v }
|
||||||
process.run
|
exec args.shelljoin
|
||||||
rescue Errno::EACCES
|
rescue Errno::EACCES
|
||||||
error "not executable: #{args.first}"
|
error "not executable: #{args.first}"
|
||||||
rescue Errno::ENOENT
|
rescue Errno::ENOENT
|
||||||
error "command not found: #{args.first}"
|
error "command not found: #{args.first}"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Process.wait(pid)
|
||||||
|
end
|
||||||
|
|
||||||
desc "version", "Display Foreman gem version"
|
desc "version", "Display Foreman gem version"
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user