From 60aec0ee9f5ce41888e260f91e15fd459c40c875 Mon Sep 17 00:00:00 2001 From: CrendKing <975235+CrendKing@users.noreply.github.com> Date: Wed, 30 Dec 2020 17:00:38 -0800 Subject: [PATCH] Fix bug that empty log directories are created on any command with --help argument (#753) --- internal/logfile/logfile.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/logfile/logfile.go b/internal/logfile/logfile.go index 95605bb84..b37b10a12 100644 --- a/internal/logfile/logfile.go +++ b/internal/logfile/logfile.go @@ -57,6 +57,10 @@ // Initialize is invoked as part of command execution to create log file just before it's needed. func Initialize(ctx *kingpin.ParseContext) error { + if *logDir == "" { + return nil + } + now := clock.Now() suffix := "unknown"