Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions src/Moryx.Cli.Templates/Solution.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,25 @@ public static void Assert(string dir, Action<string> then, Action<string> onErro

public static string GetSolutionName(string dir, Action<string> onError)
{
var files = Directory.GetFiles(dir, "*.sln");
if (files != null)
var files = Directory.GetFiles(dir, "*.slnx");
if (files.Length == 0)
{
files = Directory.GetFiles(dir, "*.sln");
}

if (files.Length > 1)
{
if (files.Length == 1)
{
return Path.GetFileNameWithoutExtension(files[0]);
}
if (files.Length > 1)
{
onError("Too many `.sln` found. Please make sure, there is only one solution.");
onError("Too many _solutions_ found. Please make sure, there is only one solution.");
return "";
}
}
onError("No `.sln` found. Please make sure, there is a VisualStudio solution in this directory.");
onError("No _solutions_ found. Please make sure, there is a VisualStudio solution in this directory.");
return "";
}
}
Expand Down
Loading