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