From 9b0a8d27c6b18f726e4e647029956a4c19b4bda6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20K=C3=B6nig?= Date: Thu, 13 Feb 2025 12:16:07 +0100 Subject: [PATCH] feat: use watchfile on windows --- src/commands/LogsCommand.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/commands/LogsCommand.ts b/src/commands/LogsCommand.ts index a4bc076..336de7a 100644 --- a/src/commands/LogsCommand.ts +++ b/src/commands/LogsCommand.ts @@ -1,5 +1,6 @@ import chalk from "chalk" import fs from "fs/promises" +import os from "os" import { Tail } from "tail" import * as yargs from "yargs" import { BaseCommand } from "./BaseCommand.js" @@ -41,7 +42,7 @@ export class LogsCommand extends BaseCommand { } private tailLogs(logFilePath: string): void { - const tail = new Tail(logFilePath, { fromBeginning: false, fsWatchOptions: {}, follow: true }) + const tail = new Tail(logFilePath, { fromBeginning: false, fsWatchOptions: {}, follow: true, useWatchFile: os.platform() === "win32" }) tail.on("line", (data) => { console.log(data)