aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.FileSystem/FileSystemManager.cs
diff options
context:
space:
mode:
authorVictoria Plitt <Victoria.Plitt@twine-s.com>2020-03-18 11:24:39 +0200
committerVictoria Plitt <Victoria.Plitt@twine-s.com>2020-03-18 11:24:39 +0200
commit18e15c056c25eccbd54f9f82c25630d900d2aa60 (patch)
treec4fdc5b5dc99cd78e5c7995580cf12a0510903dc /Software/Visual_Studio/Tango.FileSystem/FileSystemManager.cs
parent23e661dfbb74dc67ea097ae331cadd2446997b31 (diff)
parentcb7fff096f2fe6812184a286290eaad193c7c2df (diff)
downloadTango-18e15c056c25eccbd54f9f82c25630d900d2aa60.tar.gz
Tango-18e15c056c25eccbd54f9f82c25630d900d2aa60.zip
Merge
Diffstat (limited to 'Software/Visual_Studio/Tango.FileSystem/FileSystemManager.cs')
-rw-r--r--Software/Visual_Studio/Tango.FileSystem/FileSystemManager.cs16
1 files changed, 16 insertions, 0 deletions
diff --git a/Software/Visual_Studio/Tango.FileSystem/FileSystemManager.cs b/Software/Visual_Studio/Tango.FileSystem/FileSystemManager.cs
index f0b86becf..44c8f1901 100644
--- a/Software/Visual_Studio/Tango.FileSystem/FileSystemManager.cs
+++ b/Software/Visual_Studio/Tango.FileSystem/FileSystemManager.cs
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
+using System.Text.RegularExpressions;
using System.Threading.Tasks;
using Tango.FileSystem.Network;
@@ -41,6 +42,21 @@ namespace Tango.FileSystem
return GetRoot();
}
+ try
+ {
+ if (request.Path.Count(x => x == '%') == 2)
+ {
+ var variable = Regex.Match(request.Path, "(?<=%)(.*?)(?=%)").Value;
+ request.Path = request.Path.Replace($"%{variable}%", Environment.ExpandEnvironmentVariables($"%{variable}%"));
+ }
+ }
+ catch
+ {
+ throw new ArgumentException("Could not parse environment variable.");
+ }
+
+ request.Path = Path.GetFullPath(request.Path);
+
if (!Directory.Exists(request.Path))
{
throw new DirectoryNotFoundException("The specified directory could not be located.");