diff --git a/run b/run index 5af38f4e..1659e161 100755 --- a/run +++ b/run @@ -73,6 +73,7 @@ function clean() { git branch -D $testBranch > /dev/null 2>&1 git branch -D $solutionBranch > /dev/null 2>&1 git branch -D $workshopBranch > /dev/null 2>&1 + git branch -D "${workshopBranch}-end" > /dev/null 2>&1 git branch | grep -e '^\s*workshop-step[0-9]$' | xargs git branch -D > /dev/null 2>&1 git tag --list | grep -e '^step[0-9]$' | xargs git tag -d > /dev/null 2>&1 @@ -198,6 +199,10 @@ function addEndStepNavigationCommand(){ cat << EOF > ./jumpToNextStep #!/bin/bash +git add -A +git commit -m "Abort test" +git checkout -b ${workshopBranch}-end ${solutionBranch} + printf '$MessageColor' echo "" echo "" @@ -309,6 +314,10 @@ function addEndNavigationCommand(){ cat << EOF > ./next #!/bin/bash +git add -A +git commit -m "Resolve test" +git merge --no-edit $testBranch + printf '$MessageColor' echo "" echo "" diff --git a/run.ps1 b/run.ps1 index 0ac38802..48cdcd9c 100644 --- a/run.ps1 +++ b/run.ps1 @@ -46,6 +46,12 @@ Write-Host "" Write-Host "" "@ +$jumpToEndStepCommandTemplate = @" +git add -A +git commit -m "Abort test" +git checkout -b $workshopBranch-end $solutionBranch +"@ + $displayEndMessageTemplate = @" Write-Host "" Write-Host "" @@ -136,6 +142,7 @@ function clean(){ git branch -D $testBranch *> $null git branch -D $solutionBranch *> $null git branch -D $workshopBranch *> $null + git branch -D ($workshopBranch + "-end") *> $null generateTags | %{ git branch -D ($workshopBranch + "-" + $_) } *> $null generateTags | %{ git tag -d $_ } *> $null } @@ -159,7 +166,9 @@ function addStepNavigationCommand($nextStepTag, $nextStepNum){ } function addEndStepNavigationCommand(){ - $displayEndMessageTemplate | out-file 'jumpToNextStep.ps1' -enc ascii + $nextCommandContent = $jumpToEndStepCommandTemplate + "`r`n" + $displayEndMessageTemplate + + $nextCommandContent | out-file 'jumpToNextStep.ps1' -enc ascii git add jumpToNextStep.ps1 > $null git commit -m "Add end step navigation commands" > $null @@ -234,7 +243,8 @@ function addNavigationCommand($nextTestTag, $nextTestNum, $currentStepNum){ } function addEndNavigationCommand(){ - $displayEndMessageTemplate | out-file 'next.ps1' -enc ascii + $nextCommandContent = $nextCommandTemplate.Replace("@@nexttag@@", $testBranch) + "`r`n" + $displayEndMessageTemplate + $nextCommandContent | out-file 'next.ps1' -enc ascii git add next.ps1 > $null git commit -m "Add end test navigation commands" > $null