Changes to xdg to append powershell path

This commit is contained in:
v-alexjo
2016-06-09 09:50:36 -07:00
committed by Andrew Schwartzmeyer
parent 29e97bf1aa
commit 237c659b5e
3 changed files with 33 additions and 28 deletions
+16 -18
View File
@@ -181,29 +181,27 @@ namespace Microsoft.PowerShell
{
//PSReadline does not have access to Utils.CorePSPlatform. Must set PSReadline path seperately
string modulepath = System.Environment.GetEnvironmentVariable("XDG_CACHE_HOME");
if (String.IsNullOrEmpty(modulepath))
{
modulepath = System.IO.Path.Combine(
Environment.GetEnvironmentVariable("HOME"),
".config/powershell/modules");
HistorySavePath = System.IO.Path.Combine(
Environment.GetEnvironmentVariable("HOME"),
modulepath,
"PSReadLine",
hostName + "_history.txt");
}
else {
if (!String.IsNullOrEmpty(modulepath))
{
modulepath = System.IO.Path.Combine(modulepath, "powershell");
HistorySavePath = modulepath;
}
else
{
modulepath = System.IO.Path.Combine(
Environment.GetEnvironmentVariable("HOME"),
".config/powershell/modules");
HistorySavePath = System.IO.Path.Combine(
Environment.GetEnvironmentVariable("HOME"),
modulepath,
"PSReadLine",
hostName + "_history.txt");
}
#else
}
#else
HistorySavePath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)
+ @"\Microsoft\Windows\PowerShell\PSReadline\" + hostName + "_history.txt";
#endif