Skip to content

armgit / dashy

Public Imported from GitHub
0

πŸš€ A self-hostable personal dashboard built for you. Includes status-checking, widgets, themes, icon packs, a UI editor and tons more!

:notebook: Adds in-code docs to rebiuld app server function

Alicia Sykesec3db490b20e
diff --git a/services/rebuild-app.js b/services/rebuild-app.js
index 9d00156a..b3ce046c 100644
--- a/services/rebuild-app.js
+++ b/services/rebuild-app.js
@@ -5,15 +5,17 @@
const { exec } = require('child_process');
module.exports = () => new Promise((resolve, reject) => {
- const buildProcess = exec('npm run build');
+ const buildProcess = exec('npm run build'); // Trigger the build command
- let output = '';
+ let output = ''; // Will store console output
+ // Write output to console, and append to var for returning
buildProcess.stdout.on('data', (data) => {
process.stdout.write(data);
output += data;
});
+ // Handle errors, by sending the reject
buildProcess.on('error', (error) => {
reject(Error({
success: false,
@@ -22,6 +24,7 @@ module.exports = () => new Promise((resolve, reject) => {
}));
});
+ // When finished, check success, make message and resolve response
buildProcess.on('exit', (response) => {
const success = response === 0;
const message = `Build process exited with ${response}: `