Fix multi-word argument handling in foreman run.

This commit is contained in:
Daniel Brockman
2012-06-06 15:36:59 +02:00
parent 4a13122082
commit 3ea5de42aa
5 changed files with 26 additions and 15 deletions
+3 -2
View File
@@ -2,6 +2,7 @@ require "foreman"
require "foreman/helpers"
require "foreman/engine"
require "foreman/export"
require "shellwords"
require "thor"
require "yaml"
@@ -59,12 +60,12 @@ class Foreman::CLI < Thor
puts "valid procfile detected (#{engine.procfile.process_names.join(', ')})"
end
desc "run COMMAND", "Run a command using your application's environment"
desc "run COMMAND [ARGS...]", "Run a command using your application's environment"
def run(*args)
engine.apply_environment!
begin
exec args.join(" ")
exec args.shelljoin
rescue Errno::EACCES
error "not executable: #{args.first}"
rescue Errno::ENOENT
+1 -1
View File
@@ -62,7 +62,7 @@ private
$stdout.reopen writer
$stderr.reopen writer
reader.close
exec Foreman.runner, "-d", basedir, command
exec Foreman.runner, "-d", basedir, *command.shellsplit
end
end
[ reader, pid ]