scm/git: allow introspecting path lookup
Print path of first detected Git instead of executing it. This is hidden behind a `--homebrew=print-path` argument that is unlikely to conflict with any existing or future Git flags.
This commit is contained in:
parent
96cbce015e
commit
a8165b6dbd
@ -23,6 +23,10 @@ def exec(*args)
|
||||
# prevent fork-bombs
|
||||
arg0 = args.first
|
||||
return if arg0 =~ /^#{F}/i || Pathname.new(arg0).realpath == SELF_REAL
|
||||
if ARGV == %w[--homebrew=print-path]
|
||||
puts arg0
|
||||
exit
|
||||
end
|
||||
super
|
||||
end
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user