mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2025-03-05 20:49:04 -08:00
fix(unity): output corrupt with CRLF line ending
This commit is contained in:
parent
25484bf1bd
commit
8ac08ad9e9
|
@ -64,6 +64,7 @@ func (u *Unity) GetUnityVersion() (version string, err error) {
|
|||
|
||||
versionStartIndex := versionPrefixIndex + len(versionPrefix)
|
||||
unityVersion := firstLine[versionStartIndex:]
|
||||
unityVersion = strings.TrimSpace(unityVersion)
|
||||
|
||||
return strings.TrimSuffix(unityVersion, "f1"), nil
|
||||
}
|
||||
|
|
|
@ -147,6 +147,18 @@ func TestUnitySegment(t *testing.T) {
|
|||
VersionFileExists: true,
|
||||
VersionFileText: "2021.3.16f1",
|
||||
},
|
||||
{
|
||||
Case: "CRLF line ending",
|
||||
ExpectedOutput: "\ue721 2021.3.16 C# 9",
|
||||
ExpectedToBeEnabled: true,
|
||||
VersionFileExists: true,
|
||||
VersionFileText: "m_EditorVersion: 2021.3.16f1\r\nm_EditorVersionWithRevision: 2021.3.16f1 (4016570cf34f)\r\n",
|
||||
CacheGet: CacheGet{
|
||||
key: "2021.3",
|
||||
val: "C# 9",
|
||||
found: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
for _, tc := range cases {
|
||||
|
|
Loading…
Reference in a new issue