From 2515f15b009bb68482e22e1d751987d09633639e Mon Sep 17 00:00:00 2001 From: Adel Salakh Date: Fri, 27 Jan 2023 15:39:39 +0100 Subject: [PATCH] feature: warn & exit on config file changes --- packages/cli/src/index.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/cli/src/index.ts b/packages/cli/src/index.ts index 2a035a27..3d367c6e 100644 --- a/packages/cli/src/index.ts +++ b/packages/cli/src/index.ts @@ -185,6 +185,10 @@ if (isWatchMode && fileOverride) { } try { + chokidar.watch(configPath).on('change', () => { + console.log('Config file changed. Exiting.'); + process.exit(); + }); const config = parseConfig(configPath, connectionUri); main(config, isWatchMode || false, fileOverride).catch((e) => debug('error in main: %o', e.message),