From 494e8c09fa28fac539ca2e1657d1c4379b9aefb5 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Fri, 3 Aug 2018 20:51:05 +0100 Subject: [PATCH] Bugfix: Don't crash if the preset file couldn't be found.\nThis makes automating SpritePacker simpler. --- SpritePacker-CLI/Program.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/SpritePacker-CLI/Program.cs b/SpritePacker-CLI/Program.cs index 9e2837d..6442157 100644 --- a/SpritePacker-CLI/Program.cs +++ b/SpritePacker-CLI/Program.cs @@ -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;