From ee40212e9772941b49a4bdb1e95f99913cdea469 Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Thu, 28 Sep 2017 23:05:02 +0900 Subject: Update FZF_DEFAULT_COMMAND - Use bash for `set -o pipefail` - Fall back to simpler find command when the original command failed Related: #1061 --- src/constants.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/constants.go') diff --git a/src/constants.go b/src/constants.go index cfd3a3bc..d5445299 100644 --- a/src/constants.go +++ b/src/constants.go @@ -55,7 +55,7 @@ var defaultCommand string func init() { if !util.IsWindows() { - defaultCommand = `command find -L . -mindepth 1 \( -path '*/\.*' -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' -o -fstype 'proc' \) -prune -o -type f -print -o -type l -print 2> /dev/null | cut -b3-` + defaultCommand = `set -o pipefail; (command find -L . -mindepth 1 \( -path '*/\.*' -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' -o -fstype 'proc' \) -prune -o -type f -print -o -type l -print || command find -L . -mindepth 1 -path '*/\.*' -prune -o -type f -print -o -type l -print) 2> /dev/null | cut -b3-` } else if os.Getenv("TERM") == "cygwin" { defaultCommand = `sh -c "command find -L . -mindepth 1 -path '*/\.*' -prune -o -type f -print -o -type l -print 2> /dev/null | cut -b3-"` } else { -- cgit v1.2.3