Skip to content

Commit

Permalink
Fixed unreported file path parsing issue
Browse files Browse the repository at this point in the history
Fixed an issue with file paths that do not contain any directory
name(s), i.e. are just a single file name, which would cause Tharsis to
crash; also increased version number for new, fixed build and changed
startup message
  • Loading branch information
xdanieldzd committed Jan 14, 2016
1 parent e4d7f82 commit 8ffa098
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
9 changes: 6 additions & 3 deletions Tharsis/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ static void Main(string[] args)

StringBuilder headerString = new StringBuilder();
headerString.AppendFormat("Tharsis {0}.{1} - Generic Game File Converter\n", ApplicationVersion.Major, ApplicationVersion.Minor);
headerString.Append("Written 2014 by xdaniel - http://magicstone.de/dzd/\n");
headerString.Append("Written 2014-2016 by xdaniel - http://magicstone.de/dzd/\n");
headerString.Append("ETC1 support based on rg_etc1 by Rich Geldreich");

Console.WriteLine(headerString.ToString().Center(2).StyleLine(LineType.Overline | LineType.Underline));
Expand Down Expand Up @@ -84,8 +84,11 @@ static void Main(string[] args)
}
}

string displayInput = InputPath.Replace(Path.GetDirectoryName(InputPath), "").TrimStart(Path.DirectorySeparatorChar);
if (!Directory.Exists(Path.GetDirectoryName(outputPath))) Directory.CreateDirectory(Path.GetDirectoryName(outputPath));
string inputFileDirectory = Path.GetDirectoryName(InputPath);
string displayInput = (inputFileDirectory != string.Empty ? InputPath.Replace(Path.GetDirectoryName(InputPath), "").TrimStart(Path.DirectorySeparatorChar) : InputPath);

string outputFileDirectory = Path.GetDirectoryName(outputPath);
if (outputFileDirectory != string.Empty && !Directory.Exists(outputFileDirectory)) Directory.CreateDirectory(outputFileDirectory);

if ((File.Exists(outputPath) && KeepExistingFiles) || fileType == null)
Console.WriteLine("Skipping {0}...", displayInput);
Expand Down
4 changes: 2 additions & 2 deletions Tharsis/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern
// übernehmen, indem Sie "*" eingeben:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.7.0.0")]
[assembly: AssemblyFileVersion("0.7.0.0")]
[assembly: AssemblyVersion("0.8.0.0")]
[assembly: AssemblyFileVersion("0.8.0.0")]

0 comments on commit 8ffa098

Please sign in to comment.