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:
parent
5831cff0fc
commit
88fa6b7e06
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue