From b4aa8ce344768b243a466cdf5b36c713fb90ce14 Mon Sep 17 00:00:00 2001 From: GotthardG <51994228+GotthardG@users.noreply.github.com> Date: Tue, 10 Dec 2024 16:45:25 +0100 Subject: [PATCH] fixed bug with spreadsheet import --- frontend/fetch-openapi.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/frontend/fetch-openapi.js b/frontend/fetch-openapi.js index 141eb9b..c894efa 100644 --- a/frontend/fetch-openapi.js +++ b/frontend/fetch-openapi.js @@ -109,8 +109,14 @@ async function fetchAndGenerate() { } } -const backendDirectory = path.resolve('/Users/gotthardg/PycharmProjects/heidi-v2/backend/app'); +// Define backendDirectory based on ENVIRONMENT variable +const ENVIRONMENT = process.env.ENVIRONMENT || 'dev'; +const backendDirectory = ENVIRONMENT === 'test' + ? path.resolve('/home/jungfrau/heidi-v2/backend/app') + : path.resolve('/Users/gotthardg/PycharmProjects/heidi-v2/backend/app'); + console.log(`👀 Watching for changes in ${backendDirectory}`); + const watcher = chokidar.watch(backendDirectory, { persistent: true, ignored: [SCHEMA_PATH, OUTPUT_DIRECTORY] }); watcher