Skip to content

Commit

Permalink
add some logs to template puml
Browse files Browse the repository at this point in the history
  • Loading branch information
milesstoetzner authored Jul 18, 2023
1 parent 8f30498 commit c2e2741
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/controller/template/puml/topology.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export type TemplatePUMLTopologyOptions = {

export default async function (options: TemplatePUMLTopologyOptions) {
validator.ensureDefined(options.path, 'Path not defined')
console.log(`Handling file "${path.resolve(options.path)}"`)

const output = options.output ?? options.path.replace(/(\.yaml|\.yml)/, '.topology.puml')
if (!output.endsWith('.puml')) throw new Error(`Output path "${output}" does not end with '.puml'`)
Expand All @@ -27,6 +28,7 @@ export default async function (options: TemplatePUMLTopologyOptions) {
}
)

console.log(`Writing file "${path.resolve(output)}" if changed`)
files.storeFile(output, plot, {onlyIfChanged: true})
}

Expand Down
2 changes: 2 additions & 0 deletions src/controller/template/puml/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export type TemplatePUMLTypesOptions = {

export default async function (options: TemplatePUMLTypesOptions) {
validator.ensureDefined(options.path, 'Path not defined')
console.log(`Handling file "${path.resolve(options.path)}"`)

const outputDir = options.output ?? files.getDirectory(options.path)
files.assertDirectory(outputDir)
Expand Down Expand Up @@ -40,6 +41,7 @@ export default async function (options: TemplatePUMLTypesOptions) {
)
if (!output.endsWith('.puml')) throw new Error(`Output path "${output}" does not end with '.puml'`)

console.log(`Writing file "${output}" if changed`)
files.storeFile(output, plot, {onlyIfChanged: true})
}
}

0 comments on commit c2e2741

Please sign in to comment.