@ -129,18 +129,38 @@ public abstract class ProjectCreationCommandBase
SolutionName solutionName ;
if ( MicroserviceServiceTemplateBase . IsMicroserviceServiceTemplate ( template ) )
{
var sln File = Directory . GetFiles ( outputFolderRoot , "*.sln" ) . FirstOrDefault ( ) ;
var sln Path = commandLineArgs . Options . GetOrNull ( Options . MainSolution . Short , Options . MainSolution . Long ) ;
if ( sln File = = null )
if ( sln Path = = null )
{
throw new CliUsageException ( "This command should be run inside a folder that contains a microservice solution!" ) ;
slnPath = Directory . GetFiles ( outputFolderRoot , "*.sln" ) . FirstOrDefault ( ) ;
}
else if ( slnPath . EndsWith ( ".sln" ) )
{
Directory . SetCurrentDirectory ( Path . GetDirectoryName ( slnPath ) ) ;
outputFolderRoot = Path . GetDirectoryName ( slnPath ) ;
}
else if ( ! Directory . Exists ( slnPath ) )
{
slnPath = null ;
}
else
{
Directory . SetCurrentDirectory ( slnPath ) ;
outputFolderRoot = slnPath ;
slnPath = Directory . GetFiles ( outputFolderRoot , "*.sln" ) . FirstOrDefault ( ) ;
}
if ( slnPath = = null )
{
throw new CliUsageException ( $"This command should be run inside a folder that contains a microservice solution! Or use -{Options.MainSolution.Short} parameter." ) ;
}
var microserviceSolutionName = Path . GetFileName ( slnFile ) . RemovePostFix ( ".sln" ) ;
var microserviceSolutionName = Path . GetFileName ( sln Path ) . RemovePostFix ( ".sln" ) ;
version ? ? = SolutionPackageVersionFinder . Find ( slnFile ) ;
version ? ? = SolutionPackageVersionFinder . Find ( sln Path ) ;
solutionName = SolutionName . Parse ( microserviceSolutionName , projectName ) ;
outputFolder = MicroserviceServiceTemplateBase . CalculateTargetFolder ( outputFolderRoot , projectName ) ;
outputFolder = MicroserviceServiceTemplateBase . CalculateTargetFolder ( outputFolderRoot , solutionName. P rojectName) ;
uiFramework = uiFramework = = UiFramework . NotSpecified ? FindMicroserviceSolutionUiFramework ( outputFolderRoot ) : uiFramework ;
}
else
@ -512,5 +532,11 @@ public abstract class ProjectCreationCommandBase
{
public const string Short = "pwa" ;
}
public static class MainSolution
{
public const string Short = "ms" ;
public const string Long = "main-solution" ;
}
}
}