Browse Source

minor changes

pull/1379/head
Yunus Emre Kalkan 7 years ago
parent
commit
05051241d3
  1. 4
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/NewCommand.cs
  2. 6
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/CreateProjectResultZipStep.cs
  3. 8
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/FileEntryListReadStep.cs

4
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/NewCommand.cs

@ -62,7 +62,8 @@ namespace Volo.Abp.Cli.Commands
using (var templateFileStream = new MemoryStream(result.ZipContent)) using (var templateFileStream = new MemoryStream(result.ZipContent))
{ {
var zipInputStream = new ZipInputStream(templateFileStream); using (var zipInputStream = new ZipInputStream(templateFileStream))
{
var zipEntry = zipInputStream.GetNextEntry(); var zipEntry = zipInputStream.GetNextEntry();
while (zipEntry != null) while (zipEntry != null)
{ {
@ -89,6 +90,7 @@ namespace Volo.Abp.Cli.Commands
zipEntry = zipInputStream.GetNextEntry(); zipEntry = zipInputStream.GetNextEntry();
} }
} }
}
Logger.LogInformation($"Successfully created the project '{commandLineArgs.Target}'"); Logger.LogInformation($"Successfully created the project '{commandLineArgs.Target}'");
Logger.LogInformation($"The output folder is: '{outputFolder}'"); Logger.LogInformation($"The output folder is: '{outputFolder}'");

6
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/CreateProjectResultZipStep.cs

@ -15,7 +15,8 @@ namespace Volo.Abp.Cli.ProjectBuilding.Building.Steps
{ {
using (var memoryStream = new MemoryStream()) using (var memoryStream = new MemoryStream())
{ {
var zipOutputStream = new ZipOutputStream(memoryStream); using (var zipOutputStream = new ZipOutputStream(memoryStream))
{
zipOutputStream.SetLevel(3); //0-9, 9 being the highest level of compression zipOutputStream.SetLevel(3); //0-9, 9 being the highest level of compression
foreach (var entry in entries) foreach (var entry in entries)
@ -28,9 +29,8 @@ namespace Volo.Abp.Cli.ProjectBuilding.Building.Steps
} }
zipOutputStream.CloseEntry(); zipOutputStream.CloseEntry();
zipOutputStream.IsStreamOwner = false; zipOutputStream.IsStreamOwner = false;
zipOutputStream.Close(); }
memoryStream.Position = 0; memoryStream.Position = 0;
return memoryStream.ToArray(); return memoryStream.ToArray();

8
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/FileEntryListReadStep.cs

@ -15,12 +15,13 @@ namespace Volo.Abp.Cli.ProjectBuilding.Building.Steps
} }
private static FileEntryList GetEntriesFromZipFile(byte[] fileBytes) private static FileEntryList GetEntriesFromZipFile(byte[] fileBytes)
{
using (var memoryStream = new MemoryStream(fileBytes))
{ {
var fileEntries = new List<FileEntry>(); var fileEntries = new List<FileEntry>();
var zipInputStream = new ZipInputStream(memoryStream); using (var memoryStream = new MemoryStream(fileBytes))
{
using (var zipInputStream = new ZipInputStream(memoryStream))
{
var zipEntry = zipInputStream.GetNextEntry(); var zipEntry = zipInputStream.GetNextEntry();
while (zipEntry != null) while (zipEntry != null)
{ {
@ -34,6 +35,7 @@ namespace Volo.Abp.Cli.ProjectBuilding.Building.Steps
zipEntry = zipInputStream.GetNextEntry(); zipEntry = zipInputStream.GetNextEntry();
} }
}
return new FileEntryList(fileEntries); return new FileEntryList(fileEntries);
} }

Loading…
Cancel
Save