Skip to content

Commit db05226

Browse files
authored
Merge pull request #116 from xcz1997/master
自动补全具有多值属性string(s)的字段的末尾分号字符
2 parents 63192ae + d59af24 commit db05226

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

DebUOS/Packaging.DebUOS/DebUOSPackageFileStructCreator.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,9 @@ public void CreatePackagingFolder(DebUOSConfiguration configuration)
103103
// 这里不能使用 AppendLine 方法,保持换行使用 \n 字符
104104
stringBuilder
105105
.Append("[Desktop Entry]\n")
106-
.Append($"Categories={configuration.DesktopCategories}\n")
106+
.Append($"Categories={configuration.DesktopCategories.TrimEnd(',')};\n")
107107
.Append($"Name={configuration.AppName}\n")
108-
.Append($"Keywords={configuration.DesktopKeywords}\n")
108+
.Append($"Keywords={configuration.DesktopKeywords.TrimEnd(',')};\n")
109109
.Append($"Comment={configuration.DesktopComment}\n")
110110
.Append($"Type={configuration.DesktopType}\n")
111111
.Append($"Terminal={configuration.DesktopTerminal.ToString().ToLowerInvariant()}\n")
@@ -118,7 +118,7 @@ public void CreatePackagingFolder(DebUOSConfiguration configuration)
118118

119119
if (!string.IsNullOrEmpty(configuration.DesktopKeywordsZhCN))
120120
{
121-
stringBuilder.Append($"Keywords[zh_CN]={configuration.DesktopKeywordsZhCN}\n");
121+
stringBuilder.Append($"Keywords[zh_CN]={configuration.DesktopKeywordsZhCN.TrimEnd(';')};\n");
122122
}
123123

124124
if (!string.IsNullOrEmpty(configuration.DesktopCommentZhCN))
@@ -149,7 +149,7 @@ public void CreatePackagingFolder(DebUOSConfiguration configuration)
149149

150150
if (!string.IsNullOrEmpty(configuration.DesktopMimeType))
151151
{
152-
stringBuilder.Append($"MimeType={configuration.DesktopMimeType}\n");
152+
stringBuilder.Append($"MimeType={configuration.DesktopMimeType.TrimEnd(';')};\n");
153153
}
154154

155155
File.WriteAllText(desktopFile, stringBuilder.ToString(), encoding);

0 commit comments

Comments
 (0)