mirror of https://github.com/abpframework/abp.git
committed by
GitHub
4 changed files with 86 additions and 3 deletions
@ -0,0 +1,19 @@ |
|||
using Volo.Abp.Cli.ProjectBuilding.Building; |
|||
|
|||
namespace Volo.Abp.Cli.Args; |
|||
|
|||
public class AngularThemeConfigurationArgs |
|||
{ |
|||
public Theme Theme { get; } |
|||
|
|||
public string ProjectName { get; } |
|||
|
|||
public string AngularFolderPath { get; } |
|||
|
|||
public AngularThemeConfigurationArgs(Theme theme, string projectName, string angularFolderPath) |
|||
{ |
|||
Theme = theme; |
|||
ProjectName = projectName; |
|||
AngularFolderPath = angularFolderPath; |
|||
} |
|||
} |
|||
@ -0,0 +1,30 @@ |
|||
using System; |
|||
using Volo.Abp.Cli.Args; |
|||
using Volo.Abp.Cli.Utils; |
|||
using Volo.Abp.DependencyInjection; |
|||
|
|||
namespace Volo.Abp.Cli.ProjectModification; |
|||
|
|||
public class AngularThemeConfigurer : ITransientDependency |
|||
{ |
|||
private readonly ICmdHelper _cmdHelper; |
|||
|
|||
public AngularThemeConfigurer(ICmdHelper cmdHelper) |
|||
{ |
|||
_cmdHelper = cmdHelper; |
|||
} |
|||
|
|||
public void Configure(AngularThemeConfigurationArgs args) |
|||
{ |
|||
if (args.ProjectName.IsNullOrEmpty() || args.AngularFolderPath.IsNullOrEmpty()) |
|||
{ |
|||
return; |
|||
} |
|||
|
|||
var command = "npx ng g @abp/ng.schematics:change-theme " + |
|||
$"--name {(int)args.Theme} " + |
|||
$"--target-project {args.ProjectName}"; |
|||
|
|||
_cmdHelper.RunCmd(command, workingDirectory: args.AngularFolderPath); |
|||
} |
|||
} |
|||
Loading…
Reference in new issue