Keep colored output of mkdocs server

This commit is contained in:
squidfunk 2016-11-01 20:57:30 +01:00
parent 2e9b339d84
commit 971aa3de0b

View File

@ -40,19 +40,8 @@ export default () => {
server.kill()
/* Spawn MkDocs server */
server = child.spawn("mkdocs", ["serve", "-a", "0.0.0.0:8000"])
/* 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())
server = child.spawn("mkdocs", ["serve", "-a", "0.0.0.0:8000"], {
stdio: "inherit"
})
}
}