Skip to content

Commit d9fc294

Browse files
committed
fix: change no game package exception into warning
1 parent a973f70 commit d9fc294

1 file changed

Lines changed: 11 additions & 12 deletions

File tree

Interface/Actions/UnpackGameAction.cs

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ namespace FEZRepacker.Interface.Actions
66
{
77
internal class UnpackGameAction : CommandLineAction
88
{
9+
private static string[] ExpectedPackagesFileNames = ["Essentials.pak", "Music.pak", "Other.pak", "Updates.pak"];
10+
911
private const string FezContentDirectory = "fez-content-directory";
1012
private const string DestinationFolder = "destination-folder";
1113
private const string UseLegacyAo = "use-legacy-ao";
@@ -30,25 +32,22 @@ public void Execute(Dictionary<string, string> args)
3032
var contentPath = args[FezContentDirectory];
3133
var outputDir = args[DestinationFolder];
3234

33-
var packagePaths = new string[] { "Essentials.pak", "Music.pak", "Other.pak", "Updates.pak" }
34-
.Select(path => Path.Combine(contentPath, path)).ToArray();
35-
36-
foreach (var packagePath in packagePaths)
37-
{
38-
if (!File.Exists(packagePath))
39-
{
40-
throw new Exception($"Given directory is not FEZ's Content directory (missing {Path.GetFileName(packagePath)}).");
41-
}
42-
}
43-
4435
var settings = new FormatConverterSettings
4536
{
4637
UseLegacyArtObjectBundle = args.ContainsKey(UseLegacyAo),
4738
UseLegacyTrileSetBundle = args.ContainsKey(UseLegacyTs)
4839
};
4940

50-
foreach (var packagePath in packagePaths)
41+
foreach (var packageFileName in ExpectedPackagesFileNames)
5142
{
43+
var packagePath = Path.Combine(contentPath, packageFileName);
44+
45+
if (!File.Exists(packagePath))
46+
{
47+
Console.WriteLine($"Warning: Expected package file {packageFileName} not found.");
48+
continue;
49+
}
50+
5251
var actualOutputDir = outputDir;
5352
if (packagePath.EndsWith("Music.pak"))
5453
{

0 commit comments

Comments
 (0)