Skip to content

Commit

Permalink
headlamp-plugin: Do not exit process when watching for changes
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
joaquimrocha committed Mar 25, 2024
1 parent cc19d5f commit 5a0f3ee
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions plugins/headlamp-plugin/bin/headlamp-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down

0 comments on commit 5a0f3ee

Please sign in to comment.