Skip to content

Commit 52dc830

Browse files
committed
Jump to last commit
1 parent 66e485f commit 52dc830

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

run

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ function clean() {
7373
git branch -D $testBranch > /dev/null 2>&1
7474
git branch -D $solutionBranch > /dev/null 2>&1
7575
git branch -D $workshopBranch > /dev/null 2>&1
76+
git branch -D "${workshopBranch}-end" > /dev/null 2>&1
7677

7778
git branch | grep -e '^\s*workshop-step[0-9]$' | xargs git branch -D > /dev/null 2>&1
7879
git tag --list | grep -e '^step[0-9]$' | xargs git tag -d > /dev/null 2>&1
@@ -198,6 +199,10 @@ function addEndStepNavigationCommand(){
198199
cat << EOF > ./jumpToNextStep
199200
#!/bin/bash
200201
202+
git add -A
203+
git commit -m "Abort test"
204+
git checkout -b ${workshopBranch}-end ${solutionBranch}
205+
201206
printf '$MessageColor'
202207
echo ""
203208
echo ""
@@ -309,6 +314,10 @@ function addEndNavigationCommand(){
309314
cat << EOF > ./next
310315
#!/bin/bash
311316
317+
git add -A
318+
git commit -m "Resolve test"
319+
git merge --no-edit $testBranch
320+
312321
printf '$MessageColor'
313322
echo ""
314323
echo ""

run.ps1

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ Write-Host ""
4646
Write-Host ""
4747
"@
4848

49+
$jumpToEndStepCommandTemplate = @"
50+
git add -A
51+
git commit -m "Abort test"
52+
git checkout -b $workshopBranch-end $solutionBranch
53+
"@
54+
4955
$displayEndMessageTemplate = @"
5056
Write-Host ""
5157
Write-Host ""
@@ -136,6 +142,7 @@ function clean(){
136142
git branch -D $testBranch *> $null
137143
git branch -D $solutionBranch *> $null
138144
git branch -D $workshopBranch *> $null
145+
git branch -D ($workshopBranch + "-end") *> $null
139146
generateTags | %{ git branch -D ($workshopBranch + "-" + $_) } *> $null
140147
generateTags | %{ git tag -d $_ } *> $null
141148
}
@@ -159,7 +166,9 @@ function addStepNavigationCommand($nextStepTag, $nextStepNum){
159166
}
160167

161168
function addEndStepNavigationCommand(){
162-
$displayEndMessageTemplate | out-file 'jumpToNextStep.ps1' -enc ascii
169+
$nextCommandContent = $jumpToEndStepCommandTemplate + "`r`n" + $displayEndMessageTemplate
170+
171+
$nextCommandContent | out-file 'jumpToNextStep.ps1' -enc ascii
163172
git add jumpToNextStep.ps1 > $null
164173

165174
git commit -m "Add end step navigation commands" > $null
@@ -234,7 +243,8 @@ function addNavigationCommand($nextTestTag, $nextTestNum, $currentStepNum){
234243
}
235244

236245
function addEndNavigationCommand(){
237-
$displayEndMessageTemplate | out-file 'next.ps1' -enc ascii
246+
$nextCommandContent = $nextCommandTemplate.Replace("@@nexttag@@", $testBranch) + "`r`n" + $displayEndMessageTemplate
247+
$nextCommandContent | out-file 'next.ps1' -enc ascii
238248
git add next.ps1 > $null
239249

240250
git commit -m "Add end test navigation commands" > $null

0 commit comments

Comments
 (0)