From 1ff3d1aaf49bf892b68d4442706c78ab06de809e Mon Sep 17 00:00:00 2001 From: Yannick Brosseau Date: Mon, 16 Dec 2024 11:42:47 -0500 Subject: [PATCH] Add a warning message that import dir does not exist in downloadOsmNetworkData Closes: #739 --- .../src/tasks/osrm/downloadOsmNetworkData.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/chaire-lib-common/src/tasks/osrm/downloadOsmNetworkData.ts b/packages/chaire-lib-common/src/tasks/osrm/downloadOsmNetworkData.ts index 0bea5358..f897aa54 100644 --- a/packages/chaire-lib-common/src/tasks/osrm/downloadOsmNetworkData.ts +++ b/packages/chaire-lib-common/src/tasks/osrm/downloadOsmNetworkData.ts @@ -71,6 +71,12 @@ export class DownloadOsmNetworkData implements GenericTask { const polygonFile = filePath ? (filePath as string) : importDir + 'polygon.geojson'; const osmRawDataFile = osmRawFile ? (osmRawFile as string) : importDir + 'osm_network_data.osm'; + // Check that the import directory is present. It's automatically created by the main transition app normally + if (!this._fileManager.fileExistsAbsolute(importDir)) { + console.log('Import directory does not exist, please create ', importDir); + return; + } + // Run the task const polygonGeojson = await this._promptPolygon.getPolygon(polygonFile, { interactive: filePath !== undefined ? false : defaultInteractive