Skip to content

Commit 5ac75f3

Browse files
committed
wip
1 parent 932c207 commit 5ac75f3

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

packages/mcl/src/src/mcl/commands/dev_commit.d

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import std.file : dirEntries, SpanMode, readText;
1515

1616

1717
string[] modifiedFiles = [];
18-
18+
string[] gitIgnore = [];
1919
enum CommitType
2020
{
2121
feat,
@@ -33,12 +33,13 @@ enum CommitType
3333

3434
bool inGitIgnore(string file)
3535
{
36-
auto gitIgnore = readText("./.gitignore").split("\n");
3736
foreach (string line; gitIgnore)
3837
{
3938
if (line.startsWith("#") || line == "")
4039
continue;
41-
if (globMatch(file, line))
40+
else if (globMatch(file, line))
41+
return true;
42+
else if (file.startsWith(line ~ "/"))
4243
return true;
4344
}
4445
return false;
@@ -131,6 +132,7 @@ string[] getAuthors()
131132
export void dev_commit()
132133
{
133134
initGitDiff();
135+
gitIgnore = readText("./.gitignore").split("\n");
134136
writeln(guessScope().join("\n"));
135137
return;
136138

0 commit comments

Comments
 (0)