Added check for Maven project in updater and getTypeForFolder for the user class #33

Merged
NorbiPeti merged 4 commits from dev into master 2017-06-19 07:17:00 +00:00
2 changed files with 10 additions and 1 deletions
Showing only changes of commit ed637dec16 - Show all commits

View file

@ -7,7 +7,6 @@ import org.bukkit.command.CommandSender;
import org.bukkit.command.PluginCommand;
import org.bukkit.plugin.java.JavaPlugin;
import buttondevteam.lib.TBMCCoreAPI;
import buttondevteam.lib.chat.CommandClass;
import buttondevteam.lib.chat.TBMCChatAPI;
import buttondevteam.lib.chat.TBMCCommandBase;

View file

@ -81,6 +81,16 @@ public class TBMCCoreAPI {
error(sender, "Can't find branch \"" + branch + "\" for plugin \"" + correctname + "\"");
return false;
}
try {
if (DownloadString("https://raw.githubusercontent.com/TBMCPlugins/" + correctname + "/"
+ correctbranch.get() + "/pom.xml").equals("404: Not Found\n")) {
error(sender, "The plugin doesn't appear to have a pom.xml. Make sure it's a Maven project.");
return false;
}
} catch (IOException e1) {
error(sender, "The plugin doesn't appear to have a pom.xml. Make sure it's a Maven project.\n" + e1);
return false;
}
info(sender, "Updating TBMC plugin: " + correctname + " from " + correctbranch.get());
URL url;
final boolean isWindows = System.getProperty("os.name").contains("Windows");