Browse Source

Use DirectoryHelper.CreateIfNotExists in CSharpServiceProxyGenerator

pull/23850/head
Yunus Emre Kalkan 12 months ago
parent
commit
9b5ad640bc
  1. 6
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ServiceProxying/CSharp/CSharpServiceProxyGenerator.cs

6
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ServiceProxying/CSharp/CSharpServiceProxyGenerator.cs

@ -191,7 +191,7 @@ public class CSharpServiceProxyGenerator : ServiceProxyGeneratorBase<CSharpServi
classTemplateEmptyPart.Replace(NamespacePlaceholder, rootNamespace);
var filePath = Path.Combine(args.WorkDirectory, folder, $"{clientProxyName}.cs");
Directory.CreateDirectory(Path.GetDirectoryName(filePath)!);
DirectoryHelper.CreateIfNotExists(Path.GetDirectoryName(filePath)!);
if (!File.Exists(filePath))
{
using (var writer = new StreamWriter(filePath))
@ -227,7 +227,7 @@ public class CSharpServiceProxyGenerator : ServiceProxyGeneratorBase<CSharpServi
classTemplate.Replace($"{Environment.NewLine}{Environment.NewLine} {MethodPlaceholder}", string.Empty).Replace(MethodPlaceholder, string.Empty);
filePath = Path.Combine(args.WorkDirectory, folder, $"{clientProxyName}.Generated.cs");
Directory.CreateDirectory(Path.GetDirectoryName(filePath)!);
DirectoryHelper.CreateIfNotExists(Path.GetDirectoryName(filePath)!);
using (var writer = new StreamWriter(filePath))
{
await writer.WriteAsync(classTemplate.ToString());
@ -257,7 +257,7 @@ public class CSharpServiceProxyGenerator : ServiceProxyGeneratorBase<CSharpServi
interfaceTemplate.Replace(NamespacePlaceholder, rootNamespace);
filePath = Path.Combine(args.WorkDirectory, folder, $"{appServiceTypeName}.cs");
Directory.CreateDirectory(Path.GetDirectoryName(filePath)!);
DirectoryHelper.CreateIfNotExists(Path.GetDirectoryName(filePath)!);
using (var writer = new StreamWriter(filePath))
{
await writer.WriteAsync(interfaceTemplate.ToString());

Loading…
Cancel
Save