1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-04 02:09:37 +02:00

Allow continusously printing logs through tail and parse-log

This commit is contained in:
Florent 2022-08-16 08:06:49 +02:00 committed by Chocobozzz
parent cbdbee807d
commit 045224d5eb
3 changed files with 18 additions and 4 deletions

View file

@ -1,6 +1,7 @@
import { program } from 'commander'
import { createReadStream, readdir } from 'fs-extra'
import { join } from 'path'
import { stdin } from 'process'
import { createInterface } from 'readline'
import { format as sqlFormat } from 'sql-formatter'
import { inspect } from 'util'
@ -89,7 +90,7 @@ async function run () {
function readFile (file: string) {
console.log('Opening %s.', file)
const stream = createReadStream(file)
const stream = file === '-' ? stdin : createReadStream(file)
const rl = createInterface({
input: stream
@ -117,7 +118,7 @@ function readFile (file: string) {
}
})
stream.once('close', () => res())
stream.once('end', () => res())
})
}