mirror of
https://github.com/chylex/Minecraft-Phantom-Panel.git
synced 2024-11-23 19:42:51 +01:00
17 lines
437 B
C#
17 lines
437 B
C#
namespace Phantom.Utils.IO;
|
|
|
|
public static class Paths {
|
|
public static string ExpandTilde(string path) {
|
|
if (path == "~" || path.StartsWith("~/")) {
|
|
return string.Concat(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile, Environment.SpecialFolderOption.DoNotVerify), path.AsSpan(1));
|
|
}
|
|
else {
|
|
return path;
|
|
}
|
|
}
|
|
|
|
public static string NormalizeSlashes(string path) {
|
|
return path.Replace('\\', '/');
|
|
}
|
|
}
|