From: Jérôme Benoit Date: Wed, 6 Mar 2024 10:03:42 +0000 (+0100) Subject: refactor: use 'join' to build template relative path X-Git-Tag: v1.3.0~45 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=8c7d214a2afc023ffdf34bbae8bfd4e16961bcc4;p=e-mobility-charging-stations-simulator.git refactor: use 'join' to build template relative path Signed-off-by: Jérôme Benoit --- diff --git a/src/charging-station/Bootstrap.ts b/src/charging-station/Bootstrap.ts index 74225364..05fffa5b 100644 --- a/src/charging-station/Bootstrap.ts +++ b/src/charging-station/Bootstrap.ts @@ -43,7 +43,6 @@ import { handleUnhandledRejection, isAsyncFunction, isNotEmptyArray, - isNotEmptyString, logPrefix, logger } from '../utils/index.js' @@ -496,7 +495,10 @@ export class Bootstrap extends EventEmitter { const stationTemplateUrls = Configuration.getStationTemplateUrls()! if (isNotEmptyArray(stationTemplateUrls)) { for (const stationTemplateUrl of stationTemplateUrls) { - const templateName = `${isNotEmptyString(parse(stationTemplateUrl.file).dir) ? `${parse(stationTemplateUrl.file).dir}/` : ''}${parse(stationTemplateUrl.file).name}` + const templateName = join( + parse(stationTemplateUrl.file).dir, + parse(stationTemplateUrl.file).name + ) this.templateStatistics.set(templateName, { configured: stationTemplateUrl.numberOfStations, added: 0,