sourcegit/src/Commands/GitIgnore.cs

17 lines
394 B
C#
Raw Normal View History

using System.IO;
namespace SourceGit.Commands
{
public static class GitIgnore
{
public static void Add(string repo, string pattern)
{
var file = Path.Combine(repo, ".gitignore");
if (!File.Exists(file))
2024-06-17 03:25:57 -07:00
File.WriteAllLines(file, [pattern]);
else
2024-06-17 03:25:57 -07:00
File.AppendAllLines(file, [pattern]);
}
}
}