Skip to content

Commit 556565d

Browse files
authored
Merge pull request #14 from Geolykt/geol
Forbid suicide
2 parents d3be70e + cf52bf4 commit 556565d

3 files changed

Lines changed: 9 additions & 0 deletions

File tree

build.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ shadowJar {
4646
minimize()
4747
}
4848

49+
run {
50+
workingDir 'test'
51+
}
52+
4953
runShadow {
5054

5155
}

gradlew

100644100755
File mode changed.

src/main/java/org/mcphackers/mcp/tasks/TaskCleanup.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ public void doTask() throws Exception {
2222

2323
public void cleanup(boolean srcCleanup) throws Exception {
2424
long startTime = System.currentTimeMillis();
25+
26+
if (Files.exists(MCPPaths.get(mcp, "src").resolve("main").resolve("java").resolve("org").resolve("mcphackers"))) {
27+
throw new IllegalStateException("RMCP attempted to perform suicide. (Probably because you ran this application in the wrong folder)");
28+
}
29+
2530
int foldersDeleted = 0;
2631
Path[] pathsToDelete = new Path[] {
2732
MCPPaths.get(mcp, MCPPaths.CONF),

0 commit comments

Comments
 (0)