Skip to content

Commit 4d87f7c

Browse files
committed
Force a .gitignore in the build folder, People need to STOP ADDING THESE TO THERE GIT REPOS! It's a TEMP folder!
1 parent ef0debe commit 4d87f7c

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/main/java/net/minecraftforge/gradle/user/UserBasePlugin.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ public void applyPlugin()
110110
this.applyExternalPlugin("eclipse");
111111
this.applyExternalPlugin("idea");
112112

113+
addGitIgnore(); //Morons -.-
114+
113115
configureDeps();
114116
configureCompilation();
115117
configureEclipse();
@@ -986,4 +988,18 @@ public String resolve(String pattern, Project project, UserExtension exten)
986988
pattern = pattern.replace("{API_VERSION}", exten.getApiVersion());
987989
return pattern;
988990
}
991+
992+
private void addGitIgnore()
993+
{
994+
File git = new File(project.getBuildDir(), ".gitignore");
995+
if (!git.exists())
996+
{
997+
git.mkdir();
998+
try
999+
{
1000+
Files.write("#Seriously guys, stop commiting this to your git repo!\r\n*".getBytes(), git);
1001+
}
1002+
catch (IOException e){}
1003+
}
1004+
}
9891005
}

0 commit comments

Comments
 (0)