|
|
|
@ -62,31 +62,33 @@ namespace Volo.Abp.Cli.Commands |
|
|
|
|
|
|
|
using (var templateFileStream = new MemoryStream(result.ZipContent)) |
|
|
|
{ |
|
|
|
var zipInputStream = new ZipInputStream(templateFileStream); |
|
|
|
var zipEntry = zipInputStream.GetNextEntry(); |
|
|
|
while (zipEntry != null) |
|
|
|
using (var zipInputStream = new ZipInputStream(templateFileStream)) |
|
|
|
{ |
|
|
|
var fullZipToPath = Path.Combine(outputFolder, zipEntry.Name); |
|
|
|
var directoryName = Path.GetDirectoryName(fullZipToPath); |
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(directoryName)) |
|
|
|
{ |
|
|
|
Directory.CreateDirectory(directoryName); |
|
|
|
} |
|
|
|
|
|
|
|
var fileName = Path.GetFileName(fullZipToPath); |
|
|
|
if (fileName.Length == 0) |
|
|
|
var zipEntry = zipInputStream.GetNextEntry(); |
|
|
|
while (zipEntry != null) |
|
|
|
{ |
|
|
|
var fullZipToPath = Path.Combine(outputFolder, zipEntry.Name); |
|
|
|
var directoryName = Path.GetDirectoryName(fullZipToPath); |
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(directoryName)) |
|
|
|
{ |
|
|
|
Directory.CreateDirectory(directoryName); |
|
|
|
} |
|
|
|
|
|
|
|
var fileName = Path.GetFileName(fullZipToPath); |
|
|
|
if (fileName.Length == 0) |
|
|
|
{ |
|
|
|
zipEntry = zipInputStream.GetNextEntry(); |
|
|
|
continue; |
|
|
|
} |
|
|
|
|
|
|
|
var buffer = new byte[4096]; // 4K is optimum
|
|
|
|
using (var streamWriter = File.Create(fullZipToPath)) |
|
|
|
{ |
|
|
|
StreamUtils.Copy(zipInputStream, streamWriter, buffer); |
|
|
|
} |
|
|
|
zipEntry = zipInputStream.GetNextEntry(); |
|
|
|
continue; |
|
|
|
} |
|
|
|
|
|
|
|
var buffer = new byte[4096]; // 4K is optimum
|
|
|
|
using (var streamWriter = File.Create(fullZipToPath)) |
|
|
|
{ |
|
|
|
StreamUtils.Copy(zipInputStream, streamWriter, buffer); |
|
|
|
} |
|
|
|
zipEntry = zipInputStream.GetNextEntry(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|