Skip to content

Commit 598ba6d

Browse files
committed
refactor: rewrite Remote.IsValidURL (#1339)
Signed-off-by: leo <[email protected]>
1 parent 3232e6f commit 598ba6d

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

src/Models/Remote.cs

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -50,19 +50,7 @@ public static bool IsValidURL(string url)
5050
return true;
5151
}
5252

53-
var localPath = url;
54-
if (OperatingSystem.IsWindows())
55-
{
56-
if (url.StartsWith("file:///", StringComparison.Ordinal))
57-
localPath = url.Substring(8);
58-
}
59-
else
60-
{
61-
if (url.StartsWith("file://", StringComparison.Ordinal))
62-
localPath = url.Substring(7);
63-
}
64-
65-
return Directory.Exists(localPath);
53+
return url.StartsWith("file://", StringComparison.Ordinal) || Directory.Exists(url);
6654
}
6755

6856
public bool TryGetVisitURL(out string url)

0 commit comments

Comments
 (0)