Refactor code to strip out the shell prefix to a separate function

This commit is contained in:
David Dworken
2023-10-23 12:24:43 -07:00
parent 10851528bc
commit 27eeb7d099
2 changed files with 19 additions and 49 deletions

View File

@ -347,3 +347,10 @@ func installHishtory(t testing.TB, tester shellTester, userSecret string) string
}
return matches[1]
}
func stripShellPrefix(out string) string {
if strings.Contains(out, "\n\n\n") {
return strings.TrimSpace(strings.Split(out, "\n\n\n")[1])
}
return out
}