Skip to content

Instantly share code, notes, and snippets.

@sheepla
Last active October 13, 2023 09:38
Show Gist options
  • Save sheepla/ee8e864a81b4deaba3eb8a0daecd3892 to your computer and use it in GitHub Desktop.
Save sheepla/ee8e864a81b4deaba3eb8a0daecd3892 to your computer and use it in GitHub Desktop.
cd to ghq's repository selected by fzf on PowerShell
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
}
}
}
@sheepla
Copy link
Author

sheepla commented Jan 14, 2023

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment