Last active
June 24, 2024 14:36
-
-
Save shazron/3c288c2a5c538725ee114449e9871dfb to your computer and use it in GitHub Desktop.
Powershell, launch fork.exe with a directory path
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
# From https://github.com/fork-dev/TrackerWin/issues/416#issuecomment-1246248261 | |
# | |
# Launch fork.exe from the command line with a directory path argument. | |
# | |
# App: https://git-fork.com/ | |
# Usage: fork <directory_path> | |
# | |
# Load your profile in Notepad: | |
# notepad $PROFILE | |
# Then, add the contents below: | |
if ($env:OS -match 'Windows_NT') { | |
function Invoke-Fork { | |
param($Path) | |
$forkExe = "$env:LOCALAPPDATA\Fork\Fork.exe" | |
if (-not $Path) { | |
& $forkExe | |
} | |
else { | |
$absolutePath = Resolve-Path $Path | |
& $forkExe $absolutePath | |
} | |
} | |
Set-Alias fork Invoke-Fork | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment