Browse Source

Cli new command to create a project folder.

Resolve #2056
pull/2057/head
maliming 7 years ago
parent
commit
a1466b67d8
  1. 15
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/NewCommand.cs

15
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); 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); outputFolder = Path.Combine(outputFolder != null ? Path.GetFullPath(outputFolder) : Directory.GetCurrentDirectory(),
} SolutionName.Parse(commandLineArgs.Target).FullName);
else
if (!Directory.Exists(outputFolder))
{ {
outputFolder = Directory.GetCurrentDirectory(); Directory.CreateDirectory(outputFolder);
} }
Logger.LogInformation("Output folder: " + outputFolder); Logger.LogInformation("Output folder: " + outputFolder);

Loading…
Cancel
Save