Browse Source

Refactor MicroserviceServiceRandomPortStep

pull/8391/head
Yunus Emre Kalkan 5 years ago
parent
commit
bdd2a8a86c
  1. 19
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/MicroserviceServiceRandomPortStep.cs

19
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/MicroserviceServiceRandomPortStep.cs

@ -59,9 +59,7 @@ namespace Volo.Abp.Cli.ProjectBuilding.Building.Steps
return _tyeFileContent;
}
var solutionFolderPath = context.BuildArgs.ExtraProperties[NewCommand.Options.OutputFolder.Short] ??
context.BuildArgs.ExtraProperties[NewCommand.Options.OutputFolder.Long] ??
Directory.GetCurrentDirectory();
var solutionFolderPath = GetSolutionFolderPath(context);
var tyeFilePath = Path.Combine(solutionFolderPath, "tye.yaml");
@ -74,5 +72,20 @@ namespace Volo.Abp.Cli.ProjectBuilding.Building.Steps
return _tyeFileContent;
}
private static string GetSolutionFolderPath(ProjectBuildContext context)
{
if (context.BuildArgs.ExtraProperties.ContainsKey(NewCommand.Options.OutputFolder.Short))
{
return context.BuildArgs.ExtraProperties[NewCommand.Options.OutputFolder.Short];
}
if (context.BuildArgs.ExtraProperties.ContainsKey(NewCommand.Options.OutputFolder.Long))
{
return context.BuildArgs.ExtraProperties[NewCommand.Options.OutputFolder.Long];
}
return Directory.GetCurrentDirectory();
}
}
}

Loading…
Cancel
Save