Skip to content

Commit 9b5ad64

Browse files
committed
Use DirectoryHelper.CreateIfNotExists in CSharpServiceProxyGenerator
1 parent 813fc7b commit 9b5ad64

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ private async Task GenerateClassFileAsync(
191191
classTemplateEmptyPart.Replace(NamespacePlaceholder, rootNamespace);
192192

193193
var filePath = Path.Combine(args.WorkDirectory, folder, $"{clientProxyName}.cs");
194-
Directory.CreateDirectory(Path.GetDirectoryName(filePath)!);
194+
DirectoryHelper.CreateIfNotExists(Path.GetDirectoryName(filePath)!);
195195
if (!File.Exists(filePath))
196196
{
197197
using (var writer = new StreamWriter(filePath))
@@ -227,7 +227,7 @@ private async Task GenerateClassFileAsync(
227227
classTemplate.Replace($"{Environment.NewLine}{Environment.NewLine} {MethodPlaceholder}", string.Empty).Replace(MethodPlaceholder, string.Empty);
228228

229229
filePath = Path.Combine(args.WorkDirectory, folder, $"{clientProxyName}.Generated.cs");
230-
Directory.CreateDirectory(Path.GetDirectoryName(filePath)!);
230+
DirectoryHelper.CreateIfNotExists(Path.GetDirectoryName(filePath)!);
231231
using (var writer = new StreamWriter(filePath))
232232
{
233233
await writer.WriteAsync(classTemplate.ToString());
@@ -257,7 +257,7 @@ private async Task GenerateClassFileAsync(
257257
interfaceTemplate.Replace(NamespacePlaceholder, rootNamespace);
258258

259259
filePath = Path.Combine(args.WorkDirectory, folder, $"{appServiceTypeName}.cs");
260-
Directory.CreateDirectory(Path.GetDirectoryName(filePath)!);
260+
DirectoryHelper.CreateIfNotExists(Path.GetDirectoryName(filePath)!);
261261
using (var writer = new StreamWriter(filePath))
262262
{
263263
await writer.WriteAsync(interfaceTemplate.ToString());

0 commit comments

Comments
 (0)