From fa772e32366a87504783c64f9d6536e644abfc12 Mon Sep 17 00:00:00 2001 From: redraskal Date: Sun, 3 Mar 2024 19:25:09 -0600 Subject: [PATCH] fix: excel output --- main.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index e66293d..c3ea95b 100644 --- a/main.go +++ b/main.go @@ -102,9 +102,12 @@ func setup() { log.Fatal().Msg("Specify a valid match replay file/folder path (*.rec files)") } else if extra > 0 { viper.Set("input", pflag.Args()[0]) - if strings.HasSuffix(pflag.Args()[0], ".xlsx") { + } + if !viper.IsSet("format") { + output := viper.GetString("output") + if strings.HasSuffix(output, ".xlsx") { viper.Set("format", "excel") - } else if strings.HasSuffix(pflag.Args()[0], ".json") { + } else if strings.HasSuffix(output, ".json") { viper.Set("format", "json") } }