Skip to content

Commit

Permalink
fix(bindgen): node output file mountdirs varName
Browse files Browse the repository at this point in the history
  • Loading branch information
thewtex committed Sep 25, 2023
1 parent c87eb63 commit 996fa35
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ async function applyPresentationStateToImageNode(
{ type: InterfaceTypes.Image },
]

mountDirs.add(path.dirname(value as string))
mountDirs.add(path.dirname(value as string))
mountDirs.add(path.dirname(imageIn as string))
mountDirs.add(path.dirname(presentationStateFile as string))
const inputs: Array<PipelineInput> = [
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ async function readDicomEncapsulatedPdfNode(
{ type: InterfaceTypes.BinaryStream },
]

mountDirs.add(path.dirname(value as string))
mountDirs.add(path.dirname(dicomFile as string))
const inputs: Array<PipelineInput> = [
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ async function structuredReportToHtmlNode(
{ type: InterfaceTypes.TextStream },
]

mountDirs.add(path.dirname(value as string))
mountDirs.add(path.dirname(dicomFile as string))
const inputs: Array<PipelineInput> = [
]

Expand Down Expand Up @@ -127,7 +127,7 @@ async function structuredReportToHtmlNode(
}
if (typeof options.cssFile !== "undefined") {
const cssFile = options.cssFile
mountDirs.add(path.dirname(value as string))
mountDirs.add(path.dirname(cssFile as string))
args.push('--css-file')

const name = cssFile as string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ async function structuredReportToTextNode(
{ type: InterfaceTypes.TextStream },
]

mountDirs.add(path.dirname(value as string))
mountDirs.add(path.dirname(dicomFile as string))
const inputs: Array<PipelineInput> = [
]

Expand Down
4 changes: 2 additions & 2 deletions src/bindgen/typescript/function-module.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function readFileIfNotInterfaceType(forNode, interfaceType, varName, indent, isA
if (isArray) {
return `${indent}value.forEach((p) => mountDirs.add(path.dirname(p) as string))\n`
} else {
return `${indent}mountDirs.add(path.dirname(value as string))\n`
return `${indent}mountDirs.add(path.dirname(${varName} as string))\n`
}

} else {
Expand Down Expand Up @@ -363,7 +363,7 @@ function functionModule (srcOutputDir, forNode, interfaceJson, modulePascalCase,
if (interfaceType.includes('File')) {
// for files
if (forNode) {
functionContent += ' mountDirs.add(path.dirname(value as string))\n'
functionContent += ` mountDirs.add(path.dirname(value as string))\n`
functionContent += ' args.push(value as string)\n'
} else {
functionContent += readFileIfNotInterfaceType(forNode, interfaceType, 'value', ' ', false)
Expand Down

0 comments on commit 996fa35

Please sign in to comment.