Skip to content

Commit 07c9a2f

Browse files
authored
💚 Fix CodeGen on Linux/WSL (#1133)
The codegen did not start using `dotnet run --project CodeGen` because there were still back-slashes used in NanoFrameworkGenerator. Tested in WSL
1 parent 224d649 commit 07c9a2f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

CodeGen/Generators/NanoFrameworkGenerator.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ public static void Generate(string rootDir, Quantity[] quantities, QuantityNameT
101101
{ " decimal ", " double " },
102102
{ "(decimal ", "(double " }
103103
};
104-
new FileInfo($"{outputDir}\\Units\\{quantity.Name}Unit.g.cs").EditFile(replacements);
105-
new FileInfo($"{outputDir}\\Quantities\\{quantity.Name}.g.cs").EditFile(replacements);
104+
new FileInfo(Path.Combine(outputDir, "Units", $"{quantity.Name}Unit.g.cs")).EditFile(replacements);
105+
new FileInfo(Path.Combine(outputDir, "Quantities", $"{quantity.Name}.g.cs")).EditFile(replacements);
106106
}
107107

108108
Log.Information("✅ {Quantity} (nanoFramework)", quantity.Name);
@@ -272,7 +272,7 @@ public static bool UpdateNanoFrameworkDependencies(
272272
private static NanoFrameworkVersions ParseCurrentNanoFrameworkVersions(string rootDir)
273273
{
274274
// Angle has both mscorlib and System.Math dependency
275-
string generatedCodePath = Path.Combine(rootDir, "UnitsNet.NanoFramework\\GeneratedCode");
275+
string generatedCodePath = Path.Combine(rootDir, "UnitsNet.NanoFramework", "GeneratedCode");
276276
var angleProjectFile = Path.Combine(generatedCodePath, "Angle", "Angle.nfproj");
277277
var projectFileContent = File.ReadAllText(angleProjectFile);
278278

0 commit comments

Comments
 (0)