Skip to content

Commit

Permalink
Merge pull request #116 from xcz1997/master
Browse files Browse the repository at this point in the history
自动补全具有多值属性string(s)的字段的末尾分号字符
  • Loading branch information
lindexi authored Mar 20, 2024
2 parents 63192ae + d59af24 commit db05226
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions DebUOS/Packaging.DebUOS/DebUOSPackageFileStructCreator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@ public void CreatePackagingFolder(DebUOSConfiguration configuration)
// 这里不能使用 AppendLine 方法,保持换行使用 \n 字符
stringBuilder
.Append("[Desktop Entry]\n")
.Append($"Categories={configuration.DesktopCategories}\n")
.Append($"Categories={configuration.DesktopCategories.TrimEnd(',')};\n")
.Append($"Name={configuration.AppName}\n")
.Append($"Keywords={configuration.DesktopKeywords}\n")
.Append($"Keywords={configuration.DesktopKeywords.TrimEnd(',')};\n")
.Append($"Comment={configuration.DesktopComment}\n")
.Append($"Type={configuration.DesktopType}\n")
.Append($"Terminal={configuration.DesktopTerminal.ToString().ToLowerInvariant()}\n")
Expand All @@ -118,7 +118,7 @@ public void CreatePackagingFolder(DebUOSConfiguration configuration)

if (!string.IsNullOrEmpty(configuration.DesktopKeywordsZhCN))
{
stringBuilder.Append($"Keywords[zh_CN]={configuration.DesktopKeywordsZhCN}\n");
stringBuilder.Append($"Keywords[zh_CN]={configuration.DesktopKeywordsZhCN.TrimEnd(';')};\n");
}

if (!string.IsNullOrEmpty(configuration.DesktopCommentZhCN))
Expand Down Expand Up @@ -149,7 +149,7 @@ public void CreatePackagingFolder(DebUOSConfiguration configuration)

if (!string.IsNullOrEmpty(configuration.DesktopMimeType))
{
stringBuilder.Append($"MimeType={configuration.DesktopMimeType}\n");
stringBuilder.Append($"MimeType={configuration.DesktopMimeType.TrimEnd(';')};\n");
}

File.WriteAllText(desktopFile, stringBuilder.ToString(), encoding);
Expand Down

0 comments on commit db05226

Please sign in to comment.