Bugfix: Don't crash if the preset file couldn't be found.\nThis makes automating SpritePacker simpler.

This commit is contained in:
Starbeamrainbowlabs 2018-08-03 20:51:05 +01:00
parent 92328ae39c
commit 494e8c09fa
Signed by: sbrl
GPG Key ID: 1BE5172E637709C2
1 changed files with 5 additions and 1 deletions

View File

@ -58,7 +58,11 @@ namespace SpritePacker
Verbose = true;
break;
case "--preset":
rawSourceLocations = File.ReadAllText(args[++i]);
string presetFilename = args[++i];
if (File.Exists(presetFilename))
rawSourceLocations = File.ReadAllText(presetFilename);
else
Console.Error.WriteLine("Warning: Couldn't find the preset csv file at {0}", presetFilename);
break;
case "--csv":
outputFormat = OutputFormat.CSV;