kelleyma49 / PSFzf

A PowerShell wrapper around the fuzzy finder fzf
MIT License
795 stars 36 forks source link

Cannot find fzf binary on mac os #17

Closed rzeigler closed 6 years ago

rzeigler commented 6 years ago

So, its possible that something may be misconfigured, but I have fzf installed with homebrew and working in other shells. However, I cannot import psfzf even though Get-Command can find the fzf binary. From my shell:

❯ pwsh
PowerShell v6.0.2
Copyright (c) Microsoft Corporation. All rights reserved.

https://aka.ms/pscore6-docs
Type 'help' to get help.

PS /Users/ryanzeigler> Get-Command fzf*

CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Application     fzf                                                0.0.0.0    /usr/local/bin/fzf
Application     fzf                                                0.0.0.0    /usr/local/opt/fzf/bin/fzf
Application     fzf-tmux                                           0.0.0.0    /usr/local/bin/fzf-tmux
Application     fzf-tmux                                           0.0.0.0    /usr/local/opt/fzf/bin/fzf-tmux

PS /Users/ryanzeigler> Import-Module PSFzf -ArgumentList 'Ctrl+T','Ctrl+R'
Get-Command : Cannot validate argument on parameter 'Name'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again.
At /usr/local/share/powershell/Modules/PSFzf/1.1.14/PSFzf.psm1:491 char:35
+             $result = Get-Command $_ -ErrorAction SilentlyContinue
+                                   ~~
+ CategoryInfo          : InvalidData: (:) [Get-Command], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.PowerShell.Commands.GetCommandCommand

Resolve-Path : Cannot bind argument to parameter 'Path' because it is null.
At /usr/local/share/powershell/Modules/PSFzf/1.1.14/PSFzf.psm1:493 char:52
+                 $script:FzfLocation = Resolve-Path $_.Source
+                                                    ~~~~~~~~~
+ CategoryInfo          : InvalidData: (:) [Resolve-Path], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.ResolvePathCommand

Import-Module : Failed to find fzf binary in PATH.  You can download a binary from this page: https://github.com/junegunn/fzf-bin/releases
At line:1 char:1
+ Import-Module PSFzf -ArgumentList 'Ctrl+T','Ctrl+R'
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : OperationStopped: (Failed to find ...zf-bin/releases:String) [Import-Module], RuntimeException
+ FullyQualifiedErrorId : Failed to find fzf binary in PATH.  You can download a binary from this page: https://github.com/junegunn/fzf-bin/releases,Microsoft.PowerShell.Commands.ImportModuleCommand
kelleyma49 commented 6 years ago

I was able to recreate this issue. I'll investigate tonight and hopefully resolve the issue.

kelleyma49 commented 6 years ago

Resolved in 7144b97. Please update to https://www.powershellgallery.com/packages/PSFzf/1.1.15.

Thank you for submitting the issue!