Skip to content

Commit

Permalink
[CLI] Use Path.GetExtension for *.arc and *.lub
Browse files Browse the repository at this point in the history
  • Loading branch information
hyperbx committed Nov 1, 2021
1 parent 6a6ec0f commit ac76bae
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions Marathon.CLI/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,22 @@ static void Main(string[] args)
{
Console.WriteLine($"File: {arg}\n");

switch (StringHelper.GetFullExtension(arg))
// Get last extension for overwritable formats.
switch (Path.GetExtension(arg))
{
case ".arc":
U8Archive arc = new(arg, IO.ReadMode.IndexOnly);
arc.Extract(Path.Combine(Path.GetDirectoryName(arg), Path.GetFileNameWithoutExtension(arg)));
break;

case ".lub":
LuaBinary lub = new(arg, true);
break;
}

// Get full extension for serialisable formats.
switch (StringHelper.GetFullExtension(arg))
{
case ".bin":
case ".bin.json":
{
Expand Down Expand Up @@ -133,10 +142,6 @@ static void Main(string[] args)
TimeEvent tev = new(arg, true);
break;

case ".lub":
LuaBinary lub = new(arg, true);
break;

case ".pkg":
case ".pkg.json":
AssetPackage pkg = new(arg, true);
Expand Down

0 comments on commit ac76bae

Please sign in to comment.