Skip to content

Commit

Permalink
Merge pull request #263 from qtzar/BugFix_BadMainBranch
Browse files Browse the repository at this point in the history
Fix to halt site generation if the default branch is not valid.
  • Loading branch information
dirkgroot authored Jul 7, 2023
2 parents 90e4f42 + 27ba480 commit 1a5bc94
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ class GenerateSiteCommand : Subcommand(

println("The following branches contain a valid Structurizr workspace: $branchesToGenerate")

if (!branchesToGenerate.contains(defaultBranch)) {
throw Exception("$defaultBranch does not contain a valid structurizr workspace. Site generation halted.")
}

branchesToGenerate.forEach { branch ->
println("Generating site for branch $branch")
clonedRepository.checkoutBranch(branch)
Expand Down

0 comments on commit 1a5bc94

Please sign in to comment.