From 66c6dfdd8ee0ee7c12175fa022a627aa6e6fe7d2 Mon Sep 17 00:00:00 2001 From: M Ghazi Muharam Date: Fri, 26 Jan 2024 15:32:13 +0700 Subject: [PATCH] fix(formatting): fix string to status parser --- tsh/runner.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tsh/runner.go b/tsh/runner.go index 4ab09eb..c59c0c8 100644 --- a/tsh/runner.go +++ b/tsh/runner.go @@ -172,6 +172,15 @@ func (t *TSH) parseStringToStatus(str string) *config.ProxyStatus { lines := strings.Split(str, "\n") res := &config.ProxyStatus{} for _, line := range lines { + if line == "" { + /* + In order to support newer TSH version that has + Different formatting and the updated version is on the top + we need to break the loop if the line is empty + */ + break + } + kv := strings.Split(line, ":") if len(kv) <= 1 { continue