Update FZF_DEFAULT_COMMAND

- Use bash for `set -o pipefail`
- Fall back to simpler find command when the original command failed

Related: #1061
This commit is contained in:
Junegunn Choi
2017-09-28 23:05:02 +09:00
parent 7f5f6efbac
commit ee40212e97
5 changed files with 21 additions and 8 deletions

View File

@@ -23,7 +23,7 @@ func TestReadFromCommand(t *testing.T) {
}
// Normal command
reader.fin(reader.readFromCommand(`echo abc && echo def`))
reader.fin(reader.readFromCommand("sh", `echo abc && echo def`))
if len(strs) != 2 || strs[0] != "abc" || strs[1] != "def" {
t.Errorf("%s", strs)
}
@@ -48,7 +48,7 @@ func TestReadFromCommand(t *testing.T) {
reader.startEventPoller()
// Failing command
reader.fin(reader.readFromCommand(`no-such-command`))
reader.fin(reader.readFromCommand("sh", `no-such-command`))
strs = []string{}
if len(strs) > 0 {
t.Errorf("%s", strs)