mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-16 20:48:17 -06:00
chore: prettier
This commit is contained in:
parent
968e96d2fd
commit
2bc87516d2
@ -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');
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user