mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-16 20:48:17 -06:00
feat: cleanup dev script output
This commit is contained in:
parent
7ce0cdedb0
commit
968e96d2fd
@ -5,30 +5,30 @@ const sassWatcher = chokidar.watch('styles/**/*.scss')
|
|||||||
const tsWatcher = chokidar.watch('src/**/*.ts')
|
const tsWatcher = chokidar.watch('src/**/*.ts')
|
||||||
|
|
||||||
const collectStatic = (type) => {
|
const collectStatic = (type) => {
|
||||||
console.log('bundling...')
|
console.log('[*] bundling...')
|
||||||
let args = ""
|
let args = ""
|
||||||
if (type === 'style') args += "--styles"
|
if (type === 'style') args += "--styles"
|
||||||
if (type === 'script') args += "--scripts"
|
if (type === 'script') args += "--scripts"
|
||||||
execSync(`node bundle.js ${args}`)
|
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) => {
|
||||||
err && console.error(err)
|
err && console.error(err)
|
||||||
stdout && console.log(stdout)
|
stdout && console.log(`[*] ${stdout.trim()}`)
|
||||||
stderr && console.log('python err:',stderr)
|
stderr && console.log('[**] Python Err:',stderr)
|
||||||
console.log('waiting...')
|
console.log('[*] waiting...\n')
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
sassWatcher
|
sassWatcher
|
||||||
.on('change', path => {
|
.on('change', path => {
|
||||||
console.log(`Sass file ${path} has changed`)
|
console.log(`[*] '${path}' has changed`)
|
||||||
collectStatic('style')
|
collectStatic('style')
|
||||||
})
|
})
|
||||||
|
|
||||||
tsWatcher
|
tsWatcher
|
||||||
.on('change', path => {
|
.on('change', path => {
|
||||||
console.log(`TS file ${path} has changed`)
|
console.log(`[*] '${path}' has changed`)
|
||||||
collectStatic('script')
|
collectStatic('script')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user