mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-17 12:45:47 +00:00
Initial XDG support and folder default changes
Conflicts: src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHost.cs
This commit is contained in:
1 parent
fd649c0f77
commit
54c64c9db6
6 files changed
+88
-22
No files matched your search
@@ -185,14 +185,18 @@ namespace Microsoft.PowerShell
|
||||
{
|
||||
profileDir = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) +
|
||||
@"\Microsoft\Windows\PowerShell";
|
||||
} else
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
profileDir = System.IO.Path.Combine(Environment.GetEnvironmentVariable("HOME"), ".powershell");
|
||||
//check if the user has set an XDG path in their environment variables
|
||||
profileDir = Platform.SelectProductNameForDirectory("profile");
|
||||
}
|
||||
|
||||
if (!Directory.Exists(profileDir))
|
||||
|
||||
if (!Directory.Exists(profileDir)) //xdg value may have been set but not a valid directory
|
||||
{
|
||||
Directory.CreateDirectory(profileDir);
|
||||
Console.WriteLine("The selected directory for the profile does not exist. Using the default path.");
|
||||
profileDir = Platform.SelectProductNameForDirectory("default");
|
||||
}
|
||||
ClrFacade.SetProfileOptimizationRoot(profileDir);
|
||||
}
|
||||
@@ -268,7 +272,6 @@ namespace Microsoft.PowerShell
|
||||
: "StartupProfileData-NonInteractive");
|
||||
exitCode = theConsoleHost.Run(cpp, !string.IsNullOrEmpty(preStartWarning));
|
||||
}
|
||||
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user