This commit is contained in:
Matt Nadareski
2021-02-09 21:22:56 -08:00
parent 060051778e
commit 9ffdbb2c6d
2 changed files with 6 additions and 4 deletions

View File

@@ -65,8 +65,9 @@ The following systems have headers that this program can work with:
/// <returns>True if the output file was created, false otherwise</returns>
private bool DetectTransformStore(string file, string outDir, bool nostore)
{
// Ensure the output directory
outDir = outDir.Ensure();
// Create the output directory if it doesn't exist
if (!string.IsNullOrWhiteSpace(outDir) && !Directory.Exists(outDir))
Directory.CreateDirectory(outDir);
logger.User($"\nGetting skipper information for '{file}'");

View File

@@ -59,8 +59,9 @@ The following systems have headers that this program can work with:
/// <returns>True if a header was found and appended, false otherwise</returns>
public bool RestoreHeader(string file, string outDir)
{
// Ensure the output directory
outDir = outDir.Ensure();
// Create the output directory if it doesn't exist
if (!string.IsNullOrWhiteSpace(outDir) && !Directory.Exists(outDir))
Directory.CreateDirectory(outDir);
// First, get the SHA-1 hash of the file
BaseFile baseFile = BaseFile.GetInfo(file, hashes: Hash.SHA1, asFiles: TreatAsFile.NonArchive);