Skip to content

Commit b52d5c8

Browse files
committed
Add support for solutions with .slnx extension
1 parent 0560829 commit b52d5c8

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/Moryx.Cli.Templates/Solution.cs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,25 @@ public static void Assert(string dir, Action<string> then, Action<string> onErro
1414

1515
public static string GetSolutionName(string dir, Action<string> onError)
1616
{
17-
var files = Directory.GetFiles(dir, "*.sln");
18-
if (files != null)
17+
var files = Directory.GetFiles(dir, "*.slnx");
18+
if (files.Length == 0)
19+
{
20+
files = Directory.GetFiles(dir, "*.sln");
21+
}
22+
23+
if (files.Length > 1)
1924
{
2025
if (files.Length == 1)
2126
{
2227
return Path.GetFileNameWithoutExtension(files[0]);
2328
}
2429
if (files.Length > 1)
2530
{
26-
onError("Too many `.sln` found. Please make sure, there is only one solution.");
31+
onError("Too many _solutions_ found. Please make sure, there is only one solution.");
2732
return "";
2833
}
2934
}
30-
onError("No `.sln` found. Please make sure, there is a VisualStudio solution in this directory.");
35+
onError("No _solutions_ found. Please make sure, there is a VisualStudio solution in this directory.");
3136
return "";
3237
}
3338
}

0 commit comments

Comments
 (0)