Last active
October 13, 2023 09:38
-
-
Save sheepla/ee8e864a81b4deaba3eb8a0daecd3892 to your computer and use it in GitHub Desktop.
cd to ghq's repository selected by fzf on PowerShell
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Test-Command { | |
param( | |
[Parameter(Position=1)] | |
$Name | |
) | |
$null -ne (Get-Command $Name -ErrorAction:"SilentlyContinue") | |
} | |
if ((Test-Command ghq) -and (Test-Command fzf)) { | |
function g | |
{ | |
$root = ghq root | |
$dir = [System.IO.Path]::Combine($root, (ghq list | fzf)) | |
if ([System.IO.Directory]::Exists($dir)) { | |
Set-Location $dir | |
} | |
} | |
} | |
Author
sheepla
commented
Jan 14, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment