Skip to content

Commit

Permalink
Fix resources
Browse files Browse the repository at this point in the history
  • Loading branch information
JKamsker committed Mar 12, 2024
1 parent ccde7d3 commit 9b25ab9
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
using System.IO;
using System.Text;

using JKToolKit.Spectre.AutoCompletion.Integrations.Properties;
using JKToolKit.Spectre.AutoCompletion.Properties;

public class StartArgs
{
public string Runtime { get; }
Expand Down Expand Up @@ -115,6 +116,7 @@ private static string GetResource(byte[] powershellIntegration_Install, Dictiona
var result = Encoding.UTF8.GetString(powershellIntegration_Install);
return ApplyReplacements(replacements, result);
}

private static string GetResource(string resourceName, Dictionary<string, string> replacements)
{
var result = Resources.ResourceManager.GetString(resourceName) ?? throw new InvalidOperationException($"Could not find resource '{resourceName}'.");
Expand All @@ -129,6 +131,4 @@ private static string ApplyReplacements(Dictionary<string, string> replacements,
}
return result;
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,18 @@
<InternalsAssemblyName Include="Spectre.Console.Cli" />
<PackageReference Include="IgnoresAccessChecksToGenerator" Version="0.6.0" PrivateAssets="All" />
</ItemGroup>
<ItemGroup>
<Compile Update="Properties\Resources.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Update="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>

</Project>

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9b25ab9

Please sign in to comment.