Skip to content

Commit 6fe64f6

Browse files
committed
Add debugging to C# InstallLocations.cs to determine why the support path is wrong
1 parent e3e0808 commit 6fe64f6

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

csharp/runner/SnippetRunner/InstallLocations.cs

+20-20
Original file line numberDiff line numberDiff line change
@@ -199,31 +199,31 @@ private static bool IsDirectory(string path)
199199
string? defaultConfigPath = null;
200200
string defaultSupportPath;
201201

202-
switch (Environment.OSVersion.Platform)
202+
if (OperatingSystem.IsWindows())
203203
{
204-
case PlatformID.Win32NT:
205-
defaultInstallPath = homeInstall.FullName;
206-
defaultSupportPath = homeSupport.FullName;
207-
break;
208-
case PlatformID.MacOSX:
209-
defaultInstallPath = homeInstall.FullName;
210-
defaultSupportPath = homeSupport.FullName;
211-
break;
212-
case PlatformID.Unix:
213-
defaultInstallPath = "/opt/senzing/er";
214-
defaultConfigPath = "/etc/opt/senzing";
215-
defaultSupportPath = "/opt/senzing/data";
216-
break;
217-
default:
218-
throw new NotSupportedException(
219-
"Unsupported Operating System: "
220-
+ Environment.OSVersion.Platform);
204+
defaultInstallPath = homeInstall.FullName;
205+
defaultSupportPath = homeSupport.FullName;
206+
}
207+
else if (OperatingSystem.IsMacOS())
208+
{
209+
defaultInstallPath = homeInstall.FullName;
210+
defaultSupportPath = homeSupport.FullName;
211+
}
212+
else if (OperatingSystem.IsLinux())
213+
{
214+
defaultInstallPath = "/opt/senzing/er";
215+
defaultConfigPath = "/etc/opt/senzing";
216+
defaultSupportPath = "/opt/senzing/data";
217+
}
218+
else
219+
{
220+
throw new NotSupportedException(
221+
"Unsupported Operating System: "
222+
+ Environment.OSVersion.Platform);
221223
}
222224

223225
Console.Error.WriteLine();
224226
Console.Error.WriteLine("---------------------------------");
225-
Console.Error.WriteLine("IS MACOS: " + OperatingSystem.IsMacOS());
226-
Console.Error.WriteLine("PLATFORM ID: " + Environment.OSVersion.Platform);
227227
Console.Error.WriteLine("DEFAULT SUPPORT PATH: " + defaultSupportPath);
228228
Console.Error.WriteLine("HOME SUPPORT PATH: " + homeSupport.FullName);
229229
Console.Error.WriteLine("---------------------------------");

0 commit comments

Comments
 (0)