Skip to content

Commit

Permalink
Merge pull request #20 from ghzmhrm/fix/string_to_status_formatting
Browse files Browse the repository at this point in the history
fix(formatting): fix string to status parser
  • Loading branch information
adzimzf authored Jan 29, 2024
2 parents ec483f2 + 66c6dfd commit bae9219
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tsh/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bae9219

Please sign in to comment.