We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7501588 commit 9bde797Copy full SHA for 9bde797
src/Commands/GitIgnore.cs
@@ -8,7 +8,14 @@ public static void Add(string repo, string pattern)
8
{
9
var file = Path.Combine(repo, ".gitignore");
10
if (!File.Exists(file))
11
+ {
12
File.WriteAllLines(file, [pattern]);
13
+ return;
14
+ }
15
+
16
+ var org = File.ReadAllText(file);
17
+ if (!org.EndsWith('\n'))
18
+ File.AppendAllLines(file, ["", pattern]);
19
else
20
File.AppendAllLines(file, [pattern]);
21
}
0 commit comments