[TGZTest, Build] Fix scanning levels; help; add catches

This commit is contained in:
Matt Nadareski
2016-08-25 11:36:14 -07:00
parent afccac6687
commit 0a558ed7e1
3 changed files with 26 additions and 7 deletions

View File

@@ -242,7 +242,7 @@ Options:
-rar={2} Set scanning level for RAR archives
-zip={0} Set scanning level for ZIP archives
SimpleSort scanning levels:
Archive scanning levels:
0 Hash archive and contents
1 Only hash contents
2 Only hash archive
@@ -259,10 +259,15 @@ Options:
-t=, --temp= Set the temporary directory to use
-d, --delete Delete input files
-r, --romba Enable Romba depot dir output
-7z={0} Set scanning level for 7z archives
-7z={1} Set scanning level for 7z archives
-gz={2} Set scanning level for GZip archives
-rar={2} Set scanning level for RAR archives
-zip={0} Set scanning level for ZIP archives");
-zip={1} Set scanning level for ZIP archives
Archive scanning levels:
0 Hash archive and contents
1 Only hash contents
2 Only hash archive");
break;
default:
Console.Write("This is the default help output");

View File

@@ -621,7 +621,14 @@ namespace SabreTools.Helper
// Rename the input file based on the SHA-1
string tempname = Path.Combine(Path.GetDirectoryName(input), rom.SHA1);
File.Move(input, tempname);
try
{
File.Move(input, tempname);
}
catch (Exception ex)
{
logger.Error(ex.ToString());
}
// If it doesn't exist, create the output file and then write
string outfile = Path.Combine(outdir, rom.SHA1 + ".gz");
@@ -632,7 +639,14 @@ namespace SabreTools.Helper
}
// Name the original input file correctly again
File.Move(tempname, input);
try
{
File.Move(tempname, input);
}
catch (Exception ex)
{
logger.Error(ex.ToString());
}
// Now that it's renamed, inject the header info
using (BinaryWriter sw = new BinaryWriter(new MemoryStream()))

View File

@@ -87,10 +87,10 @@ namespace SabreTools
delete = false,
romba = false,
tgz = true;
int sevenzip = 0,
int sevenzip = 1,
gz = 2,
rar = 2,
zip = 0;
zip = 1;
string outdir = "",
tempdir = "";
List<string> inputs = new List<string>();