Skip to content

Commit

Permalink
Merge pull request #154 from jp7677/diagram-exists-check
Browse files Browse the repository at this point in the history
Fix diagram exists check
  • Loading branch information
dirkgroot authored Feb 28, 2023
2 parents bc7b321 + b1da43f commit 5c2f5e8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,14 @@ class ServeCommand : Subcommand("serve", "Start a development server") {
val ms = measureTimeMillis {
broadcast("site-updating")
val workspace = createStructurizrWorkspace(File(workspaceFile))

println("Generating idex page...")
generateRedirectingIndexPage(File(siteDir), branch)
println("Copying assets...")
copySiteWideAssets(File(siteDir))
println("Generating diagrams...")
generateDiagrams(workspace, exportDir)

println("Generating site...")
copySiteWideAssets(File(siteDir))
generateRedirectingIndexPage(File(siteDir), branch)
generateSite(
"0.0.0",
workspace,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ fun generateDiagrams(workspace: Workspace, exportDir: File) {
val plantUMLFile = File(pumlDir, "${diagram.key}.puml")
if (!plantUMLFile.exists() || plantUMLFile.readText() != diagram.definition) {
println("${diagram.key}...")
saveAsPUML(diagram, plantUMLFile)
saveAsSvg(diagram, svgDir)
saveAsPng(diagram, pngDir)
saveAsPUML(diagram, plantUMLFile)
} else {
println("${diagram.key} UP-TO-DATE")
}
Expand All @@ -43,8 +43,8 @@ fun generateDiagramWithElementLinks(view: View, url: String, exportDir: File): S
val name = "${diagram.key}-${view.key}"
val plantUMLFile = File(pumlDir, "$name.puml")
if (!plantUMLFile.exists() || plantUMLFile.readText() != diagram.definition) {
saveAsPUML(diagram, plantUMLFile)
saveAsSvg(diagram, svgDir, name)
saveAsPUML(diagram, plantUMLFile)
} else {
println("$name UP-TO-DATE")
}
Expand Down

0 comments on commit 5c2f5e8

Please sign in to comment.