1
0
Fork 0
mirror of https://github.com/rails/execjs synced 2023-03-27 23:21:20 -04:00

Preserve command flags passed to which

This commit is contained in:
Stephen Waits 2011-05-05 09:32:31 -05:00 committed by Joshua Peek
parent 5831cff0fc
commit 88fa6b7e06

View file

@ -113,7 +113,7 @@ module ExecJS
def which(command)
Array(command).each do |name|
name = name.split(/\s+/).first
name, args = name.split(/\s+/, 2)
result = if ExecJS.windows?
`#{ExecJS.root}/support/which.bat #{name}`
else
@ -121,7 +121,7 @@ module ExecJS
end
if path = result.strip.split("\n").first
return path
return args ? "#{path} #{args}" : path
end
end
nil