mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-06-14 11:52:32 +03:00
Keep colored output of mkdocs server
This commit is contained in:
parent
2e9b339d84
commit
971aa3de0b
@ -40,19 +40,8 @@ export default () => {
|
|||||||
server.kill()
|
server.kill()
|
||||||
|
|
||||||
/* Spawn MkDocs server */
|
/* Spawn MkDocs server */
|
||||||
server = child.spawn("mkdocs", ["serve", "-a", "0.0.0.0:8000"])
|
server = child.spawn("mkdocs", ["serve", "-a", "0.0.0.0:8000"], {
|
||||||
|
stdio: "inherit"
|
||||||
/* Pretty print server log output */
|
|
||||||
server.stdout.on("data", data => {
|
|
||||||
const lines = data.toString().split("\n")
|
|
||||||
for (const l in lines)
|
|
||||||
if (lines[l].length)
|
|
||||||
util.log(lines[l])
|
|
||||||
})
|
|
||||||
|
|
||||||
/* Print errors to stdout */
|
|
||||||
server.stderr.on("data", data => {
|
|
||||||
process.stdout.write(data.toString())
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user