From 2ff055cd7a0328931833fc893d79656721f298a4 Mon Sep 17 00:00:00 2001 From: Gordon Smith Date: Thu, 9 Apr 2026 13:05:20 +0100 Subject: [PATCH] fix(comms): enhance wsdl file writing to support "current" output directory Signed-off-by: Gordon Smith --- packages/comms/utils/index.ts | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/packages/comms/utils/index.ts b/packages/comms/utils/index.ts index aadd4224ba..149b9c1fe1 100644 --- a/packages/comms/utils/index.ts +++ b/packages/comms/utils/index.ts @@ -393,12 +393,21 @@ wsdlToTs(args.url) if (printToConsole) { console.log(lines.join("\n").replace(/\n\n\n/g, "\n")); } else { - mkdir(finalPath, { recursive: true }).then(() => { - const tsFile = path.join(finalPath, origNS.replace(/^WS/, "Ws") + ".ts"); - writeFile(tsFile, lines.join("\n").replace(/\n\n\n/g, "\n")).then(() => { - tsfmt.processFiles([tsFile], tsFmtOpts); + const content = lines.join("\n").replace(/\n\n\n/g, "\n"); + const serviceName = origNS.replace(/^WS/, "Ws"); + const currentPath = path.join(outDir, serviceName, "current"); + const writeToDir = (dir: string) => { + return mkdir(dir, { recursive: true }).then(() => { + const tsFile = path.join(dir, serviceName + ".ts"); + return writeFile(tsFile, content).then(() => { + return tsfmt.processFiles([tsFile], tsFmtOpts); + }); }); - }).catch(e => { + }; + Promise.all([ + writeToDir(finalPath), + writeToDir(currentPath) + ]).catch(e => { console.error(e.message ?? e); if (!keepGoing) { process.exitCode = -1;