mirror of
https://github.com/velopack/velopack.git
synced 2025-10-25 15:19:22 +00:00
Add the worst Mustache parser in the world
This commit is contained in:
23
src/Update/CopStache.cs
Normal file
23
src/Update/CopStache.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Security;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Squirrel.Update
|
||||
{
|
||||
public static class CopStache
|
||||
{
|
||||
public static string Render(string template, Dictionary<string, string> identifiers)
|
||||
{
|
||||
var buf = new StringBuilder(template);
|
||||
|
||||
foreach (var key in identifiers.Keys) {
|
||||
buf.Replace("{{" + key + "}}", SecurityElement.Escape(identifiers[key]));
|
||||
}
|
||||
|
||||
return buf.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -75,6 +75,7 @@
|
||||
<Link>Properties\SolutionAssemblyInfo.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="AnimatedGifWindow.cs" />
|
||||
<Compile Include="CopStache.cs" />
|
||||
<Compile Include="Mono.Options\Options.cs" />
|
||||
<Compile Include="NativeMethods.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
|
||||
Reference in New Issue
Block a user