From 71c005b34a0662b62fddd1a01840876d9e7fec93 Mon Sep 17 00:00:00 2001 From: Tom Ritter Date: Mon, 10 Jan 2022 16:27:11 -0500 Subject: [PATCH] Change the version check invocation in install.ps1 When install.ps1 is executed inside MSYS (or cygwin I suspect) cmd is a shell script that invokes the real cmd. But in install.ps1 it tries to open this shell script instead of executing it. AFAICT the only reason to use cmd /c is to capture stderr because there is a bug with powersehll; but fzf prints the version information on stdout so we don't need to care about stderr. So we can just call the binary directly. This avoids the cmd issues. --- install.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.ps1 b/install.ps1 index 2a1549f4..b78e1ab7 100644 --- a/install.ps1 +++ b/install.ps1 @@ -4,7 +4,7 @@ $fzf_base=Split-Path -Parent $MyInvocation.MyCommand.Definition function check_binary () { Write-Host " - Checking fzf executable ... " -NoNewline - $output=cmd /c $fzf_base\bin\fzf.exe --version 2>&1 + $output= & $fzf_base\bin\fzf.exe --version if (-not $?) { Write-Host "Error: $output" $binary_error="Invalid binary"