Browse Source

Merge pull request #23700 from abpframework/add-module-skip-documentation

Add module command: added `skip-opening-documentation` option
pull/23704/head
Engincan VESKE 11 months ago
committed by GitHub
parent
commit
8799dd7cf4
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 9
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/AddModuleCommand.cs
  2. 4
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/AngularSourceCodeAdder.cs
  3. 12
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/SolutionModuleAdder.cs

9
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/AddModuleCommand.cs

@ -69,6 +69,7 @@ public class AddModuleCommand : IConsoleCommand, ITransientDependency
var newProTemplate = !string.IsNullOrEmpty(template) && template == ModuleProTemplate.TemplateName;
var withSourceCode = newTemplate || newProTemplate || commandLineArgs.Options.ContainsKey(Options.SourceCode.Long);
var addSourceCodeToSolutionFile = withSourceCode && commandLineArgs.Options.ContainsKey("add-to-solution-file");
var skipOpeningDocumentation = commandLineArgs.Options.ContainsKey(Options.SkipOpeningDocumentation.Long);
var skipDbMigrations = newTemplate || newProTemplate || commandLineArgs.Options.ContainsKey(Options.DbMigrations.Skip);
var solutionFile = GetSolutionFile(commandLineArgs);
@ -98,7 +99,8 @@ public class AddModuleCommand : IConsoleCommand, ITransientDependency
withSourceCode,
addSourceCodeToSolutionFile,
newTemplate,
newProTemplate
newProTemplate,
skipOpeningDocumentation
);
_lastAddedModuleInfo = new AddModuleInfoOutput
@ -223,5 +225,10 @@ public class AddModuleCommand : IConsoleCommand, ITransientDependency
public const string Short = "t";
public const string Long = "template";
}
public class SkipOpeningDocumentation
{
public const string Long = "skip-opening-documentation";
}
}
}

4
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/AngularSourceCodeAdder.cs

@ -14,11 +14,11 @@ namespace Volo.Abp.Cli.ProjectModification;
public class AngularSourceCodeAdder : ITransientDependency
{
public ILogger<SolutionModuleAdder> Logger { get; set; }
public ILogger<AngularSourceCodeAdder> Logger { get; set; }
public AngularSourceCodeAdder()
{
Logger = NullLogger<SolutionModuleAdder>.Instance;
Logger = NullLogger<AngularSourceCodeAdder>.Instance;
}
public async Task AddFromModuleAsync(string solutionFilePath, string angularPath)

12
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/SolutionModuleAdder.cs

@ -98,7 +98,8 @@ public class SolutionModuleAdder : ITransientDependency
bool withSourceCode = false,
bool addSourceCodeToSolutionFile = false,
bool newTemplate = false,
bool newProTemplate = false)
bool newProTemplate = false,
bool skipOpeningDocumentation = false)
{
Check.NotNull(solutionFile, nameof(solutionFile));
Check.NotNull(moduleName, nameof(moduleName));
@ -159,10 +160,13 @@ public class SolutionModuleAdder : ITransientDependency
await SetLeptonXAbpVersionsAsync(solutionFile, Path.Combine(modulesFolderInSolution, module.Name));
}
var documentationLink = module.GetFirstDocumentationLinkOrNull();
if (documentationLink != null)
if (!skipOpeningDocumentation)
{
CmdHelper.Open(documentationLink);
var documentationLink = module.GetFirstDocumentationLinkOrNull();
if (documentationLink != null)
{
CmdHelper.Open(documentationLink);
}
}
return module;

Loading…
Cancel
Save