Fix: add DirectorySeparatorChar at end of DataDirectory

This commit is contained in:
Waldi Ravens 2020-02-09 14:06:58 +01:00
parent f0aea3b5cd
commit f0835f0c41

View File

@ -125,13 +125,14 @@ namespace Nikse.SubtitleEdit.Core
{
// hack for unit tests
var assembly = System.Reflection.Assembly.GetEntryAssembly() ?? System.Reflection.Assembly.GetExecutingAssembly();
if (assembly.Location.Contains(@"\src\TestResults"))
var srcTestResultsIndex = assembly.Location.IndexOf(@"\src\TestResults", StringComparison.Ordinal);
if (srcTestResultsIndex > 0)
{
var debugOrReleaseFolderName = "Release";
#if DEBUG
debugOrReleaseFolderName = "Debug";
#endif
return $@"{assembly.Location.Substring(0, assembly.Location.IndexOf(@"\src\TestResults", StringComparison.Ordinal))}\src\Test\bin\{debugOrReleaseFolderName}";
return $@"{assembly.Location.Substring(0, srcTestResultsIndex)}\src\Test\bin\{debugOrReleaseFolderName}\";
}
var appDataRoamingPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Subtitle Edit");