File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -393,12 +393,21 @@ wsdlToTs(args.url)
393393 if ( printToConsole ) {
394394 console . log ( lines . join ( "\n" ) . replace ( / \n \n \n / g, "\n" ) ) ;
395395 } else {
396- mkdir ( finalPath , { recursive : true } ) . then ( ( ) => {
397- const tsFile = path . join ( finalPath , origNS . replace ( / ^ W S / , "Ws" ) + ".ts" ) ;
398- writeFile ( tsFile , lines . join ( "\n" ) . replace ( / \n \n \n / g, "\n" ) ) . then ( ( ) => {
399- tsfmt . processFiles ( [ tsFile ] , tsFmtOpts ) ;
396+ const content = lines . join ( "\n" ) . replace ( / \n \n \n / g, "\n" ) ;
397+ const serviceName = origNS . replace ( / ^ W S / , "Ws" ) ;
398+ const currentPath = path . join ( outDir , serviceName , "current" ) ;
399+ const writeToDir = ( dir : string ) => {
400+ return mkdir ( dir , { recursive : true } ) . then ( ( ) => {
401+ const tsFile = path . join ( dir , serviceName + ".ts" ) ;
402+ return writeFile ( tsFile , content ) . then ( ( ) => {
403+ return tsfmt . processFiles ( [ tsFile ] , tsFmtOpts ) ;
404+ } ) ;
400405 } ) ;
401- } ) . catch ( e => {
406+ } ;
407+ Promise . all ( [
408+ writeToDir ( finalPath ) ,
409+ writeToDir ( currentPath )
410+ ] ) . catch ( e => {
402411 console . error ( e . message ?? e ) ;
403412 if ( ! keepGoing ) {
404413 process . exitCode = - 1 ;
You can’t perform that action at this time.
0 commit comments