mirror of
https://github.com/ddworken/hishtory.git
synced 2025-08-16 09:58:02 +02:00
Refactor code to strip out the shell prefix to a separate function
This commit is contained in:
@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user