Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Branch list tidy up #322

Merged
merged 4 commits into from
Oct 16, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class GenerateSiteCommand : Subcommand(
refreshLocalClone()
}

val branchNames = if (allBranches)
val branchNames: List<String> = if (allBranches)
qtzar marked this conversation as resolved.
Show resolved Hide resolved
clonedRepository.getBranchNames(excludeBranches.split(","))
else
branches.split(",")
Expand All @@ -109,7 +109,12 @@ class GenerateSiteCommand : Subcommand(
throw Exception("$defaultBranch does not contain a valid structurizr workspace. Site generation halted.")
}

branchesToGenerate.forEach { branch ->
val sortedBranchNames = branchesToGenerate.toMutableList()
qtzar marked this conversation as resolved.
Show resolved Hide resolved
sortedBranchNames.sorted()
sortedBranchNames.remove(defaultBranch)
sortedBranchNames.add(0,defaultBranch)

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

Expand All @@ -120,7 +125,7 @@ class GenerateSiteCommand : Subcommand(
workspace,
assetsDir?.let { File(cloneDir, it) },
siteDir,
branchesToGenerate,
sortedBranchNames,
branch
)
}
Expand Down