Skip to content

Commit

Permalink
Merge pull request #4459 from abpframework/project-download-step-envi…
Browse files Browse the repository at this point in the history
…ronments-folder-location-in-angular

projectbuilding: change environments folder location in angular
  • Loading branch information
yekalkan authored Jun 25, 2020
2 parents d8a8d0f + 25ffc28 commit 6942bea
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand All @@ -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 += "/";
}

Expand Down Expand Up @@ -110,7 +110,7 @@ public async Task ExecuteAsync(CommandLineArgs commandLineArgs)
if (rootPath != "app")
{
Logger.LogInformation($"{rootPath} directory is creating");
}
}

if (rootPath == "app")
{
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -816,4 +816,4 @@ public class ParameterModel
public bool IsOptional { get; set; }
public string BindingSourceId { get; set; }
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit 6942bea

Please sign in to comment.