11/14
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -3,18 +3,18 @@ using System.IO.Compression;
|
||||
|
||||
namespace BatchOszExtractor.Core;
|
||||
|
||||
public class Extract
|
||||
public static class Extract
|
||||
{
|
||||
public static void SelectMaps(SelectionType type, ImmutableList<string> maps, string extractPath)
|
||||
{
|
||||
// both are immutable lists of strings
|
||||
if (type is SelectionType.Multiple or SelectionType.Single)
|
||||
if (type == SelectionType.Selection)
|
||||
{
|
||||
foreach (string map in maps)
|
||||
foreach (var map in maps)
|
||||
{
|
||||
using (ZipArchive archive = ZipFile.Open(map, ZipArchiveMode.Update))
|
||||
using (var archive = ZipFile.Open(map, ZipArchiveMode.Update))
|
||||
{
|
||||
string file = Path.GetFileName(map);
|
||||
var file = Path.GetFileName(map);
|
||||
archive.ExtractToDirectory(Path.GetFullPath(Path.Combine(extractPath, file.Remove(file.Length - 4))));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@ namespace BatchOszExtractor.Core;
|
||||
|
||||
public enum SelectionType
|
||||
{
|
||||
Single,
|
||||
Multiple,
|
||||
Selection,
|
||||
Range
|
||||
}
|
||||
Reference in New Issue
Block a user