Last active
March 1, 2022 23:35
-
-
Save peterneave/b23b47c1398ba9c93cf420d93cd957b6 to your computer and use it in GitHub Desktop.
SourceTree Go To Bitbucket
This file contains 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
#Script to Run: C:\Program Files\PowerShell\7\pwsh.exe | |
#param: c:\dev\GoToBitBucket.ps1 $REPO $SHA | |
Param( | |
[string]$REPO, | |
[string]$SHA | |
) | |
pushd $REPO | |
$var = (git remote get-url origin) | Out-String | |
popd | |
$regex = '(?<=:)[\w-.\/]+(?=\.)' | |
$var -match $regex | Out-Null | |
$ownerAndRepoPath = $Matches[0] | |
$url = "https://bitbucket.org/$ownerAndRepoPath/commits/$SHA" | |
& "C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" $url | |
#& "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" $url |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment