From a1466b67d84095529ea15ae433eaf871672c2c0e Mon Sep 17 00:00:00 2001 From: maliming Date: Fri, 1 Nov 2019 11:03:30 +0800 Subject: [PATCH] Cli new command to create a project folder. Resolve #2056 --- .../Volo/Abp/Cli/Commands/NewCommand.cs | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/NewCommand.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/NewCommand.cs index e30ed7a77f..3bebf3103a 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/NewCommand.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/NewCommand.cs @@ -71,18 +71,13 @@ namespace Volo.Abp.Cli.Commands } var outputFolder = commandLineArgs.Options.GetOrNull(Options.OutputFolder.Short, Options.OutputFolder.Long); - if (outputFolder != null) - { - if (!Directory.Exists(outputFolder)) - { - Directory.CreateDirectory(outputFolder); - } - outputFolder = Path.GetFullPath(outputFolder); - } - else + outputFolder = Path.Combine(outputFolder != null ? Path.GetFullPath(outputFolder) : Directory.GetCurrentDirectory(), + SolutionName.Parse(commandLineArgs.Target).FullName); + + if (!Directory.Exists(outputFolder)) { - outputFolder = Directory.GetCurrentDirectory(); + Directory.CreateDirectory(outputFolder); } Logger.LogInformation("Output folder: " + outputFolder);