Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,28 @@ public void delete() {
LOG.info("GitHub repo {} has been removed", ghRepo.getHtmlUrl());
}

public static void deleteAllRepos(String repoPrefix, String gitHubUsername, String gitHubPassword)
throws IOException {
GitHub gitHub = GitHub.connectUsingPassword(gitHubUsername, gitHubPassword);

gitHub
.getMyself()
.getAllRepositories()
.keySet()
.stream()
.filter(repoName -> repoName.startsWith(repoPrefix))
.forEach(
repoName -> {
String repoAddress = gitHubUsername + "/" + repoName;
LOG.info("Removing repo " + repoAddress + "...");
try {
gitHub.getRepository(repoAddress).delete();
} catch (IOException e) {
e.printStackTrace();
}
});
}

public String getHtmlUrl() {
return ghRepo.getHtmlUrl().toString();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ public enum TabButton implements Button {
this.buttonId = buttonId;
}

@Override
public String get() {
return this.buttonId;
}
Expand Down