From 2bc87516d28c548a15b088dda0f084e6488fe9d9 Mon Sep 17 00:00:00 2001 From: ndom91 Date: Sun, 5 Sep 2021 00:08:45 +0200 Subject: [PATCH] chore: prettier --- netbox/project-static/develop.js | 55 +++++++++++++++----------------- 1 file changed, 26 insertions(+), 29 deletions(-) diff --git a/netbox/project-static/develop.js b/netbox/project-static/develop.js index 7b952caa0..308d50e35 100644 --- a/netbox/project-static/develop.js +++ b/netbox/project-static/develop.js @@ -1,34 +1,31 @@ -const { exec, execSync } = require('child_process') -const chokidar = require('chokidar') +const { exec, execSync } = require('child_process'); +const chokidar = require('chokidar'); -const sassWatcher = chokidar.watch('styles/**/*.scss') -const tsWatcher = chokidar.watch('src/**/*.ts') +const sassWatcher = chokidar.watch('styles/**/*.scss'); +const tsWatcher = chokidar.watch('src/**/*.ts'); -const collectStatic = (type) => { - console.log('[*] bundling...') - let args = "" - if (type === 'style') args += "--styles" - if (type === 'script') args += "--scripts" - execSync(`node bundle.js ${args}`) +const collectStatic = type => { + console.log('[*] bundling...'); + let args = ''; + if (type === 'style') args += '--styles'; + if (type === 'script') args += '--scripts'; + execSync(`node bundle.js ${args}`); - console.log('[*] collecting...') - exec("../../venv/bin/python3 ../manage.py collectstatic --no-input", (err, stdout, stderr) => { - err && console.error(err) - stdout && console.log(`[*] ${stdout.trim()}`) - stderr && console.log('[**] Python Err:',stderr) - console.log('[*] waiting...\n') - }) -} + console.log('[*] collecting...'); + exec('../../venv/bin/python3 ../manage.py collectstatic --no-input', (err, stdout, stderr) => { + err && console.error(err); + stdout && console.log(`[*] ${stdout.trim()}`); + stderr && console.log('[**] Python Err:', stderr); + console.log('[*] waiting...\n'); + }); +}; -sassWatcher - .on('change', path => { - console.log(`[*] '${path}' has changed`) - collectStatic('style') - }) - -tsWatcher - .on('change', path => { - console.log(`[*] '${path}' has changed`) - collectStatic('script') - }) +sassWatcher.on('change', path => { + console.log(`[*] '${path}' has changed`); + collectStatic('style'); +}); +tsWatcher.on('change', path => { + console.log(`[*] '${path}' has changed`); + collectStatic('script'); +});