Allow archs_for_command to take Pathnames. Fixes Homebrew/homebrew#1106.
This commit is contained in:
parent
e05c728e45
commit
e7d7ceccee
@ -132,8 +132,9 @@ end
|
||||
|
||||
# returns array of architectures suitable for -arch gcc flag
|
||||
def archs_for_command cmd
|
||||
cmd = cmd.to_s # If we were passed a Pathname, turn it into a string.
|
||||
cmd = `/usr/bin/which #{cmd}` unless Pathname.new(cmd).absolute?
|
||||
cmd.gsub! ' ', '\\ '
|
||||
cmd.gsub! ' ', '\\ ' # Escape spaces in the filename.
|
||||
|
||||
IO.popen("/usr/bin/file #{cmd}").readlines.inject(%w[]) do |archs, line|
|
||||
case line
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user