mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-16 20:48:17 -06:00
fix: simplify type flag logic
This commit is contained in:
parent
c3fa59312c
commit
9a51849012
@ -6,10 +6,7 @@ const tsWatcher = chokidar.watch('src/**/*.ts');
|
|||||||
|
|
||||||
const collectStatic = type => {
|
const collectStatic = type => {
|
||||||
console.log('[*] bundling..');
|
console.log('[*] bundling..');
|
||||||
let args = '';
|
execSync(`node bundle.js ${type && `--${type}`}`);
|
||||||
if (type === 'style') args += '--styles';
|
|
||||||
if (type === 'script') args += '--scripts';
|
|
||||||
execSync(`node bundle.js ${args}`);
|
|
||||||
|
|
||||||
console.log('[*] collecting..');
|
console.log('[*] collecting..');
|
||||||
exec('../../venv/bin/python3 ../manage.py collectstatic --no-input', (err, stdout, stderr) => {
|
exec('../../venv/bin/python3 ../manage.py collectstatic --no-input', (err, stdout, stderr) => {
|
||||||
@ -22,10 +19,10 @@ const collectStatic = type => {
|
|||||||
|
|
||||||
sassWatcher.on('change', path => {
|
sassWatcher.on('change', path => {
|
||||||
console.log(`[*] '${path}' has changed`);
|
console.log(`[*] '${path}' has changed`);
|
||||||
collectStatic('style');
|
collectStatic('styles');
|
||||||
});
|
});
|
||||||
|
|
||||||
tsWatcher.on('change', path => {
|
tsWatcher.on('change', path => {
|
||||||
console.log(`[*] '${path}' has changed`);
|
console.log(`[*] '${path}' has changed`);
|
||||||
collectStatic('script');
|
collectStatic('scripts');
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user