Skip to content

Commit

Permalink
Fix some bugs
Browse files Browse the repository at this point in the history
- Emmchaccgen now asks you to overwrite the folder you're trying to generate a firmware into.
- Emmchaccgen now safely errors out on firmware version grabbing
  • Loading branch information
suchmememanyskill committed Jun 12, 2020
1 parent 2ad27a4 commit 8057241
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
12 changes: 12 additions & 0 deletions EmmcHaccGen/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,18 @@ void Start(string keys, string fwPath, bool noExfat, bool verbose, bool showNcaI
// Folder creation
Console.WriteLine("\nCreating folders..");

if (Directory.Exists(destFolder))
{
Console.Write("Destenation folder already exists. Delete the old folder?\nY/N: ");
string input = Console.ReadLine();

if (input[0].ToString().ToLower() != "y")
return;

Console.WriteLine($"Deleting {destFolder}");
Directory.Delete(destFolder, true);
}

foreach(string folder in FOLDERSTRUCTURE)
Directory.CreateDirectory($"{destFolder}{folder}");

Expand Down
12 changes: 10 additions & 2 deletions EmmcHaccGen/nca/VersionExtractor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,16 @@ class VersionExtractor
public VersionExtractor() { }
public VersionExtractor(NcaFile nca)
{
this.OpenVersionNca(nca);
this.Parse();
try
{
this.OpenVersionNca(nca);
this.Parse();
}
catch
{
platform = "ERR";
version = "Unkn";
}
}
private void OpenVersionNca(NcaFile nca)
{
Expand Down

0 comments on commit 8057241

Please sign in to comment.