From 9a51849012aa6a5037ad26d337a191886d6d002a Mon Sep 17 00:00:00 2001 From: ndom91 Date: Sun, 5 Sep 2021 00:27:30 +0200 Subject: [PATCH] fix: simplify type flag logic --- netbox/project-static/develop.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/netbox/project-static/develop.js b/netbox/project-static/develop.js index f57384be8..cdbcf2842 100644 --- a/netbox/project-static/develop.js +++ b/netbox/project-static/develop.js @@ -6,10 +6,7 @@ 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}`); + execSync(`node bundle.js ${type && `--${type}`}`); console.log('[*] collecting..'); exec('../../venv/bin/python3 ../manage.py collectstatic --no-input', (err, stdout, stderr) => { @@ -22,10 +19,10 @@ const collectStatic = type => { sassWatcher.on('change', path => { console.log(`[*] '${path}' has changed`); - collectStatic('style'); + collectStatic('styles'); }); tsWatcher.on('change', path => { console.log(`[*] '${path}' has changed`); - collectStatic('script'); + collectStatic('scripts'); });