From 2475debf6fce96dcfbdfa84402e9107adf04da7e Mon Sep 17 00:00:00 2001 From: Tynan McAuley Date: Fri, 10 Dec 2021 13:32:53 -0800 Subject: [PATCH] Hide `which` warning when `fd` isn't installed On some systems, if `fd` isn't installed, this call to `which` will result in a message like "which: no fd in ". This hides that warning message. --- common.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common.mk b/common.mk index 3b307317..abb148fc 100644 --- a/common.mk +++ b/common.mk @@ -65,7 +65,7 @@ include $(base_dir)/tools/torture.mk ######################################################################################### # Returns a list of files in directory $1 with file extension $2. # If available, use 'fd' to find the list of files, which is faster than 'find'. -ifeq ($(shell which fd),) +ifeq ($(shell which fd 2> /dev/null),) lookup_srcs = $(shell find -L $(1)/ -name target -prune -o -iname "*.$(2)" -print 2> /dev/null) else lookup_srcs = $(shell fd -L ".*\.$(2)" $(1))