@ -31,6 +31,7 @@ public abstract class ProjectCreationCommandBase
public SolutionPackageVersionFinder SolutionPackageVersionFinder { get ; }
public SolutionPackageVersionFinder SolutionPackageVersionFinder { get ; }
public ICmdHelper CmdHelper { get ; }
public ICmdHelper CmdHelper { get ; }
public IInstallLibsService InstallLibsService { get ; }
public IInstallLibsService InstallLibsService { get ; }
public CliService CliService { get ; }
public AngularPwaSupportAdder AngularPwaSupportAdder { get ; }
public AngularPwaSupportAdder AngularPwaSupportAdder { get ; }
public InitialMigrationCreator InitialMigrationCreator { get ; }
public InitialMigrationCreator InitialMigrationCreator { get ; }
public ILocalEventBus EventBus { get ; }
public ILocalEventBus EventBus { get ; }
@ -43,6 +44,7 @@ public abstract class ProjectCreationCommandBase
SolutionPackageVersionFinder solutionPackageVersionFinder ,
SolutionPackageVersionFinder solutionPackageVersionFinder ,
ICmdHelper cmdHelper ,
ICmdHelper cmdHelper ,
IInstallLibsService installLibsService ,
IInstallLibsService installLibsService ,
CliService cliService ,
AngularPwaSupportAdder angularPwaSupportAdder ,
AngularPwaSupportAdder angularPwaSupportAdder ,
InitialMigrationCreator initialMigrationCreator ,
InitialMigrationCreator initialMigrationCreator ,
ThemePackageAdder themePackageAdder ,
ThemePackageAdder themePackageAdder ,
@ -54,6 +56,7 @@ public abstract class ProjectCreationCommandBase
SolutionPackageVersionFinder = solutionPackageVersionFinder ;
SolutionPackageVersionFinder = solutionPackageVersionFinder ;
CmdHelper = cmdHelper ;
CmdHelper = cmdHelper ;
InstallLibsService = installLibsService ;
InstallLibsService = installLibsService ;
CliService = cliService ;
AngularPwaSupportAdder = angularPwaSupportAdder ;
AngularPwaSupportAdder = angularPwaSupportAdder ;
InitialMigrationCreator = initialMigrationCreator ;
InitialMigrationCreator = initialMigrationCreator ;
EventBus = eventBus ;
EventBus = eventBus ;
@ -62,7 +65,7 @@ public abstract class ProjectCreationCommandBase
Logger = NullLogger < NewCommand > . Instance ;
Logger = NullLogger < NewCommand > . Instance ;
}
}
protected ProjectBuildArgs GetProjectBuildArgs ( CommandLineArgs commandLineArgs , string template , string projectName )
protected async Task < ProjectBuildArgs > GetProjectBuildArgsAsync ( CommandLineArgs commandLineArgs , string template , string projectName )
{
{
var version = commandLineArgs . Options . GetOrNull ( Options . Version . Short , Options . Version . Long ) ;
var version = commandLineArgs . Options . GetOrNull ( Options . Version . Short , Options . Version . Long ) ;
@ -75,6 +78,15 @@ public abstract class ProjectCreationCommandBase
if ( preview )
if ( preview )
{
{
Logger . LogInformation ( "Preview: yes" ) ;
Logger . LogInformation ( "Preview: yes" ) ;
var cliVersion = await CliService . GetCurrentCliVersionAsync ( typeof ( CliService ) . Assembly ) ;
if ( ! cliVersion . IsPrerelease )
{
throw new CliUsageException (
"You can only create a new preview solution with preview CLI version." +
" Update your ABP CLI to the preview version." ) ;
}
}
}
var pwa = commandLineArgs . Options . ContainsKey ( Options . ProgressiveWebApp . Short ) ;
var pwa = commandLineArgs . Options . ContainsKey ( Options . ProgressiveWebApp . Short ) ;