mirror of
https://github.com/seigler/awesome-dash-platform
synced 2025-07-27 06:36:08 +00:00
update dev scripts
This commit is contained in:
parent
8d7d0222fc
commit
0544b37ba3
1 changed files with 15 additions and 10 deletions
|
@ -7,21 +7,22 @@ const cssPath = path.join(__dirname, '../src/css')
|
||||||
const jsPath = path.join(__dirname, '../src/js')
|
const jsPath = path.join(__dirname, '../src/js')
|
||||||
const http = require('http')
|
const http = require('http')
|
||||||
|
|
||||||
|
const options = {
|
||||||
|
stdout: process.stdout,
|
||||||
|
stderr: process.stderr
|
||||||
|
}
|
||||||
|
|
||||||
const runHugo = () => {
|
const runHugo = () => {
|
||||||
console.log('Rebuilding...')
|
return runAll(['build:hugo'], options).catch(() => {})
|
||||||
return runAll(['build:hugo'], {
|
|
||||||
stdout: process.stdout,
|
|
||||||
stderr: process.stderr
|
|
||||||
}).then(() => console.log('Done!')).catch(console.log)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const handler = (path) => {
|
const handler = (path) => {
|
||||||
if (path.startsWith(dataFolder)) {
|
if (path.startsWith(dataFolder)) {
|
||||||
runAll(['build:data'], {parallel: false}).then(runHugo)
|
runAll(['build:data'], options).then(runHugo)
|
||||||
} else if (path.startsWith(cssPath)) {
|
} else if (path.startsWith(cssPath)) {
|
||||||
runAll(['build:css'], {parallel: false}).then(runHugo)
|
runAll(['build:css'], options).then(runHugo)
|
||||||
} else if (path.startsWith(jsPath)) {
|
} else if (path.startsWith(jsPath)) {
|
||||||
runAll(['build:js'], {parallel: false}).then(runHugo)
|
runAll(['build:js'], options).then(runHugo)
|
||||||
} else {
|
} else {
|
||||||
runHugo()
|
runHugo()
|
||||||
}
|
}
|
||||||
|
@ -29,8 +30,12 @@ const handler = (path) => {
|
||||||
|
|
||||||
async function run () {
|
async function run () {
|
||||||
console.log('Preparing fonts, css, js and data...')
|
console.log('Preparing fonts, css, js and data...')
|
||||||
await runAll(['build:fonts', 'build:css', 'build:js', 'build:css', 'build:data'], {parallel: true})
|
await runAll(['build:fonts', 'build:css', 'build:js', 'build:icons', 'build:data'], {
|
||||||
console.log('Running Hugo once...')
|
stdout: process.stdout,
|
||||||
|
stderr: process.stderr,
|
||||||
|
parallel: true
|
||||||
|
})
|
||||||
|
|
||||||
await runHugo()
|
await runHugo()
|
||||||
|
|
||||||
console.log('Starting server...')
|
console.log('Starting server...')
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue