From 8ee0a96cd607130831a88d7faf286d43bcc251ff Mon Sep 17 00:00:00 2001 From: HoldYourWaffle Date: Mon, 10 Jun 2019 18:47:04 +0200 Subject: [PATCH] Don't add routes.ts suffix for absolute routesDir paths Fixes #360 --- src/routeGeneration/routeGenerator.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routeGeneration/routeGenerator.ts b/src/routeGeneration/routeGenerator.ts index 81654b16b..e63add3bb 100644 --- a/src/routeGeneration/routeGenerator.ts +++ b/src/routeGeneration/routeGenerator.ts @@ -23,7 +23,7 @@ export class RouteGenerator { constructor(private readonly metadata: Tsoa.Metadata, private readonly options: RoutesConfig) { } public async GenerateRoutes(middlewareTemplate: string, pathTransformer: (path: string) => string) { - const fileName = `${this.options.routesDir}/routes.ts`; + const fileName = path.isAbsolute(this.options.routesDir) ? this.options.routesDir : `${this.options.routesDir}/routes.ts`; const content = this.buildContent(middlewareTemplate, pathTransformer); const formatted = await tsfmt.processString(fileName, content, this.tsfmtConfig as any);