From 5a0f3ee26059ddf908e1584657b928ab7d0e0f76 Mon Sep 17 00:00:00 2001 From: Joaquim Rocha Date: Mon, 25 Mar 2024 09:34:37 +0000 Subject: [PATCH] headlamp-plugin: Do not exit process when watching for changes Due to a recent change, after webpack compiled or had an error compiling a plugin's code, the process was being exited, meaning that the functionality of watching for changes was broken. Signed-off-by: Joaquim Rocha --- plugins/headlamp-plugin/bin/headlamp-plugin.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/headlamp-plugin/bin/headlamp-plugin.js b/plugins/headlamp-plugin/bin/headlamp-plugin.js index 41610017c29..13522ef6a95 100755 --- a/plugins/headlamp-plugin/bin/headlamp-plugin.js +++ b/plugins/headlamp-plugin/bin/headlamp-plugin.js @@ -292,19 +292,19 @@ function start() { config.mode = 'development'; process.env['BABEL_ENV'] = 'development'; copyToPluginsFolder(config); + let exitCode = 0; webpack(config, (err, stats) => { // We are checking the exit code of the compileMessages function. // It should be 0 if there are no errors, and 1 if there are errors. - const exitCode = compileMessages(err, stats); + exitCode = compileMessages(err, stats); if (exitCode !== 0) { console.error('Failed to start watching for changes.'); } else { console.log('Watching for changes to plugin...'); } - process.exit(exitCode); }); - return 0; + return exitCode; } /**