diff options
author | Junegunn Choi <junegunn.c@gmail.com> | 2017-09-28 23:05:02 +0900 |
---|---|---|
committer | Junegunn Choi <junegunn.c@gmail.com> | 2017-09-28 23:05:02 +0900 |
commit | ee40212e9772941b49a4bdb1e95f99913cdea469 (patch) | |
tree | 799667bda43ca07dbb33b3992f10ba6ea608062e /src/constants.go | |
parent | 7f5f6efbac677603181434193abbb2a8d550b8b5 (diff) |
Update FZF_DEFAULT_COMMAND
- Use bash for `set -o pipefail`
- Fall back to simpler find command when the original command failed
Related: #1061
Diffstat (limited to 'src/constants.go')
-rw-r--r-- | src/constants.go | 2 |
1 files changed, 1 insertions, 1 deletions
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 { |