This repository has been archived on 2022-08-05. You can view files and clone it, but cannot push or open issues or pull requests.
UpTool2/Installer/PATH.cs
CreepyCrafter24 18c8419495 Random stuff
2020-03-24 22:43:57 +01:00

20 lines
631 B
C#

using System;
using System.IO;
using System.Linq;
namespace Installer
{
public static class PATH
{
public static string[] Content
{
get => Environment.GetEnvironmentVariable("path", EnvironmentVariableTarget.User).Split(';');
set => Environment.SetEnvironmentVariable("path", string.Join(';', value), EnvironmentVariableTarget.User);
}
public static void Append(string path, bool escape = true) =>
Content = Content.Append(escape ? GetName(path) : path).ToArray();
public static string GetName(string path) => Path.GetFullPath(path);
}
}