mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-28 12:56:05 +01:00
Handle db command args sanely
This commit is contained in:
parent
6d71e0f8be
commit
a0557112a1
@ -215,6 +215,7 @@ public class DatabaseCommand extends SubCommand {
|
|||||||
if (args.length < 6) {
|
if (args.length < 6) {
|
||||||
player.sendMessage(StaticCaption.of(
|
player.sendMessage(StaticCaption.of(
|
||||||
"/plot database mysql [host] [port] [username] [password] [database] {prefix}"));
|
"/plot database mysql [host] [port] [username] [password] [database] {prefix}"));
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
String host = args[1];
|
String host = args[1];
|
||||||
String port = args[2];
|
String port = args[2];
|
||||||
@ -229,6 +230,7 @@ public class DatabaseCommand extends SubCommand {
|
|||||||
case "sqlite" -> {
|
case "sqlite" -> {
|
||||||
if (args.length < 2) {
|
if (args.length < 2) {
|
||||||
player.sendMessage(StaticCaption.of("/plot database sqlite [file]"));
|
player.sendMessage(StaticCaption.of("/plot database sqlite [file]"));
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
File sqliteFile =
|
File sqliteFile =
|
||||||
FileUtils.getFile(PlotSquared.platform().getDirectory(), args[1] + ".db");
|
FileUtils.getFile(PlotSquared.platform().getDirectory(), args[1] + ".db");
|
||||||
|
Loading…
Reference in New Issue
Block a user