mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-23 06:41:42 +08:00
Detect GNU make via "--version"
Turns out that `make -pn` actually takes a while - about 300ms on fish's makefile. That's quite a bit of time just to throw away the output and use the exit code. So we just check for "GNU" in the version string. It would be nice to just _do_ the completion and fall back on the BSD-style if it doesn't work, but that is tricky to do with the pipe to `awk` - the awk expression actually does not fail if `make` does not print output. And I don't know enough about awk to change that.
This commit is contained in:
parent
9929acd9d8
commit
a4f55d95d4
|
@ -17,7 +17,7 @@ function __fish_print_make_targets --argument-names directory file
|
|||
end
|
||||
|
||||
set -l bsd_make
|
||||
if make -C $directory -pn >/dev/null 2>/dev/null
|
||||
if make --version 2>/dev/null | string match -q 'GNU*'
|
||||
set bsd_make 0
|
||||
else
|
||||
set bsd_make 1
|
||||
|
|
Loading…
Reference in New Issue
Block a user