generated from KinsonDigital/CSharpLibTemplateRepo
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🚧Fix bug with null ref exceptions on unsubscribe all (#203)
* Start work for issue #202 * config: added create pr powershell script * fix: check for null before trying to invoke unsubscribe method * test: create unit test to test for fix
- Loading branch information
1 parent
9cac8e8
commit ef864f4
Showing
3 changed files
with
96 additions
and
7 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
Clear-Host; | ||
|
||
Write-Host -NoNewline "Please enter an issue number: " -ForegroundColor Cyan; | ||
$issueNumber = Read-Host; | ||
|
||
if ($issueNumber -notmatch '^\d+$') { | ||
Write-Error "User input is not a number"; | ||
exit 1; | ||
} | ||
|
||
Write-Host -NoNewline "Please enter a branch name: " -ForegroundColor Cyan; | ||
$branchDescrip = Read-Host; | ||
|
||
$branchDescrip = $branchDescrip.ToLower(); | ||
$branchDescrip = $branchDescrip.Replace(" ", "-").Replace("_", "-"); | ||
$branchDescrip = $branchDescrip.TrimStart("-"); | ||
$branchDescrip = $branchDescrip.TrimEnd("-"); | ||
|
||
$headBranch = "feature/$issueNumber-$branchDescrip"; | ||
$commitMsg = "Start owrk for issue #$issueNumber"; | ||
|
||
$destBranch = "not-set"; | ||
|
||
$baseBranches = @("main", "preview"); | ||
Write-Host -NoNewline "Please choose a base branch from the list [$($baseBranches -join ', ')]: " -ForegroundColor Cyan; | ||
$chosenBaseBranch = Read-Host; | ||
|
||
if ($baseBranches -contains $chosenBaseBranch) { | ||
$destBranch = $chosenBaseBranch; | ||
} else { | ||
Write-Error "Invalid base branch."; | ||
exit 1; | ||
} | ||
|
||
Write-Host "`n--------------------------------`n"; | ||
|
||
Write-Host "Creating branch. . ." -ForegroundColor Yellow; | ||
git checkout -B "$headBranch"; | ||
Write-Host ""; | ||
|
||
Write-Host "Creating empty commit. . ." -ForegroundColor Yellow; | ||
git commit --allow-empty -m $commitMsg; | ||
Write-Host ""; | ||
|
||
Write-Host "Pushing branch to remote. . ." -ForegroundColor Yellow; | ||
git push --set-upstream origin "$headBranch"; | ||
Write-Host ""; | ||
|
||
Write-Host "Creating PR. . ." -ForegroundColor Yellow; | ||
gh pr create -B $destBranch -b "" -t "new pr" -d; |