Avoid verifying whether the special folder exists

We don't care at this stage, we'll fail when moving to given location
This commit is contained in:
Archi
2021-11-29 23:43:19 +01:00
parent ac02495e80
commit 6a824c2c6f

View File

@@ -127,7 +127,7 @@ internal static class Program {
// Aid userspace and replace ~ with user's home directory if possible
if (path.Contains('~', StringComparison.Ordinal)) {
try {
string homeDirectory = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
string homeDirectory = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile, Environment.SpecialFolderOption.DoNotVerify);
if (!string.IsNullOrEmpty(homeDirectory)) {
path = path.Replace("~", homeDirectory, StringComparison.Ordinal);