m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-16 15:23:48 -05:00

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

@@ -10,8 +10,14 @@ import (
"github.com/mattn/go-shellwords"
)
// ExecCommand executes the given command with $SHELL
// ExecCommand executes the given command with cmd
func ExecCommand(command string) *exec.Cmd {
return ExecCommandWith("cmd", command)
}
// ExecCommandWith executes the given command with cmd. _shell parameter is
// ignored on Windows.
func ExecCommandWith(_shell string, command string) *exec.Cmd {
args, _ := shellwords.Parse(command)
allArgs := make([]string, len(args)+1)
allArgs[0] = "/c"