From 25ffc28157969352382e25efa30bf7703c3f4ffc Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Mon, 22 Jun 2020 16:38:16 +0300 Subject: [PATCH] projectbuilding: change environments folder location in angular resolves https://github.com/abpframework/abp/issues/4458 --- .../Volo/Abp/Cli/Commands/GenerateProxyCommand.cs | 12 ++++++------ ...tFilePortChangeForSeparatedIdentityServersStep.cs | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/GenerateProxyCommand.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/GenerateProxyCommand.cs index 2b524d92728..d148346836c 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/GenerateProxyCommand.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/GenerateProxyCommand.cs @@ -51,7 +51,7 @@ public async Task ExecuteAsync(CommandLineArgs commandLineArgs) var apiUrl = commandLineArgs.Options.GetOrNull(Options.ApiUrl.Short, Options.ApiUrl.Long); if (string.IsNullOrWhiteSpace(apiUrl)) { - var environmentJson = File.ReadAllText("src/environments/environment.ts").Split("export const environment = ")[1].Replace(";", " "); + var environmentJson = File.ReadAllText("projects/dev-app/src/environments/environment.ts").Split("export const environment = ")[1].Replace(";", " "); var environment = JObject.Parse(environmentJson); apiUrl = environment["apis"]["default"]["url"].ToString(); } @@ -61,7 +61,7 @@ public async Task ExecuteAsync(CommandLineArgs commandLineArgs) output = commandLineArgs.Options.GetOrNull(Options.Output.Short, Options.Output.Long); if (!string.IsNullOrWhiteSpace(output) && !(output.EndsWith("/") || output.EndsWith("\\"))) - { + { output += "/"; } @@ -110,7 +110,7 @@ public async Task ExecuteAsync(CommandLineArgs commandLineArgs) if (rootPath != "app") { Logger.LogInformation($"{rootPath} directory is creating"); - } + } if (rootPath == "app") { @@ -536,7 +536,7 @@ private static string CreateType(JObject data, string returnValueType, string ro modelFileText.AppendLine(Environment.NewLine); modelFileText.AppendLine($"import {{ {baseTypeName} }} from '{baseTypeKebabCase}';"); - + extends = "extends " + (!string.IsNullOrWhiteSpace(customBaseTypeName) ? customBaseTypeName : baseTypeName); var modelIndex = CreateType(data, baseType, rootPath, modelIndexList, controllerPathName); @@ -628,7 +628,7 @@ private static string CreateType(JObject data, string returnValueType, string ro { from = "./" + propertyTypeKebabCase; } - + modelFileText.Insert(0, $"import {{ {propertyType} }} from '{from}';"); modelFileText.Insert(0, Environment.NewLine); modelIndexList.Add(modelIndex); @@ -816,4 +816,4 @@ public class ParameterModel public bool IsOptional { get; set; } public string BindingSourceId { get; set; } } -} \ No newline at end of file +} diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AngularEnvironmentFilePortChangeForSeparatedIdentityServersStep.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AngularEnvironmentFilePortChangeForSeparatedIdentityServersStep.cs index 9a76f9ee214..b69ce479ac9 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AngularEnvironmentFilePortChangeForSeparatedIdentityServersStep.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AngularEnvironmentFilePortChangeForSeparatedIdentityServersStep.cs @@ -10,9 +10,9 @@ public override void Execute(ProjectBuildContext context) { var fileEntries = context.Files.Where(x => !x.IsDirectory && - (x.Name.EndsWith("angular/src/environments/environment.ts", StringComparison.InvariantCultureIgnoreCase) || - x.Name.EndsWith("angular/src/environments/environment.hmr.ts", StringComparison.InvariantCultureIgnoreCase) || - x.Name.EndsWith("angular/src/environments/environment.prod.ts", StringComparison.InvariantCultureIgnoreCase)) + (x.Name.EndsWith("angular/projects/dev-app/src/environments/environment.ts", StringComparison.InvariantCultureIgnoreCase) || + x.Name.EndsWith("angular/projects/dev-app/src/environments/environment.hmr.ts", StringComparison.InvariantCultureIgnoreCase) || + x.Name.EndsWith("angular/projects/dev-app/src/environments/environment.prod.ts", StringComparison.InvariantCultureIgnoreCase)) ) .ToList();