mirror of
https://e.coding.net/circlecloud/Yum.git
synced 2025-09-02 04:46:55 +00:00
update version and add repo info ...
Signed-off-by: 502647092 <jtb1@163.com>
This commit is contained in:
@ -31,13 +31,18 @@ public class CommandRepo extends BaseCommand {
|
||||
switch (cmd) {
|
||||
case "add":
|
||||
if (args.length == 2) {
|
||||
main.repo.addRepositories(args[1]);
|
||||
if (main.repo.addRepositories(args[1])) {
|
||||
sender.sendMessage("§6仓库: §a插件信息已缓存!");
|
||||
} else {
|
||||
sender.sendMessage("§6仓库: §c源地址未找到仓库信息或无法访问!");
|
||||
}
|
||||
} else {
|
||||
sender.sendMessage("§6仓库: §c请输入源地址!");
|
||||
}
|
||||
sender.sendMessage("§6仓库: §a插件信息已缓存!");
|
||||
break;
|
||||
case "list":
|
||||
sender.sendMessage("§6仓库: §b缓存的插件信息如下 ");
|
||||
StringUtil.sendStringArray(sender, main.repo.getAllPluginString());
|
||||
StringUtil.sendStringArray(sender, main.repo.getAllPluginsInfo());
|
||||
break;
|
||||
case "clean":
|
||||
main.repo.clean();
|
||||
|
@ -9,6 +9,7 @@ package cn.citycraft.Yum.repository;
|
||||
public class PluginInfo {
|
||||
public Plugin plugin;
|
||||
public String url;
|
||||
public String repo;
|
||||
|
||||
public String getMavenUrl() {
|
||||
return String.format(url + "/%1$s/%2$s/%3$s/%2$s-%3$s.jar", plugin.groupId.replace(".", "/"), plugin.artifactId, plugin.version);
|
||||
|
@ -45,6 +45,7 @@ public class RepositoryManager {
|
||||
PluginInfo pi = new PluginInfo();
|
||||
pi.plugin = plugin;
|
||||
pi.url = pkg.url;
|
||||
pi.repo = pkg.name;
|
||||
plugins.put(plugin.groupId + "." + plugin.artifactId, pi);
|
||||
}
|
||||
}
|
||||
@ -138,11 +139,11 @@ public class RepositoryManager {
|
||||
return li;
|
||||
}
|
||||
|
||||
public List<String> getAllPluginString() {
|
||||
public List<String> getAllPluginsInfo() {
|
||||
List<String> li = new ArrayList<String>();
|
||||
for (Entry<String, PluginInfo> plugin : plugins.entrySet()) {
|
||||
Plugin pl = plugin.getValue().plugin;
|
||||
li.add(String.format("%s %s(%s) - %s", pl.groupId, pl.artifactId, pl.version, pl.description));
|
||||
li.add(String.format("%s %s(%s) - %s", plugin.getValue().repo, pl.artifactId, pl.version, pl.description));
|
||||
}
|
||||
return li;
|
||||
}
|
||||
|
Reference in New Issue
Block a user