mirror of
https://github.com/9ParsonsB/Pulsar.git
synced 2025-04-05 17:39:39 -04:00
[Core] Fix "not all code paths return a value" error when publishing (#139)
Just shuffled code within conditional compiler directives because when publishing, it seems "RELEASE" is not set. This ensures in the non PORTABLE case, the default path is set. (Discovered while testing my publishing script with signing.)
This commit is contained in:
parent
38b950cf37
commit
59d5fad5d5
@ -156,7 +156,11 @@ namespace Observatory.PluginManagement
|
||||
get
|
||||
{
|
||||
var context = new System.Diagnostics.StackFrame(1).GetMethod();
|
||||
#if DEBUG || RELEASE
|
||||
#if PORTABLE
|
||||
string? observatoryLocation = System.Diagnostics.Process.GetCurrentProcess()?.MainModule?.FileName;
|
||||
var obsDir = new FileInfo(observatoryLocation ?? String.Empty).DirectoryName;
|
||||
return $"{obsDir}{Path.DirectorySeparatorChar}plugins{Path.DirectorySeparatorChar}{context?.DeclaringType?.Assembly.GetName().Name}-Data{Path.DirectorySeparatorChar}";
|
||||
#else
|
||||
string folderLocation = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)
|
||||
+ $"{Path.DirectorySeparatorChar}ObservatoryCore{Path.DirectorySeparatorChar}{context?.DeclaringType?.Assembly.GetName().Name}{Path.DirectorySeparatorChar}";
|
||||
|
||||
@ -164,10 +168,6 @@ namespace Observatory.PluginManagement
|
||||
Directory.CreateDirectory(folderLocation);
|
||||
|
||||
return folderLocation;
|
||||
#elif PORTABLE
|
||||
string? observatoryLocation = System.Diagnostics.Process.GetCurrentProcess()?.MainModule?.FileName;
|
||||
var obsDir = new FileInfo(observatoryLocation ?? String.Empty).DirectoryName;
|
||||
return $"{obsDir}{Path.DirectorySeparatorChar}plugins{Path.DirectorySeparatorChar}{context?.DeclaringType?.Assembly.GetName().Name}-Data{Path.DirectorySeparatorChar}";
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user