Fix auto updating.

This commit is contained in:
boy0001 2015-08-20 20:48:48 +10:00
parent d0605b9b55
commit 75f189aae8
3 changed files with 3 additions and 2 deletions

View File

@ -1437,7 +1437,7 @@ public class PS {
PS.debug("&7PlotSquared is already up to date!"); PS.debug("&7PlotSquared is already up to date!");
return null; return null;
} }
dl = dl.replaceAll("${PLATFORM}", getPlatform()); dl = dl.replaceAll(Pattern.quote("${PLATFORM}"), getPlatform());
log("&6PlotSquared v" + line + " is available:"); log("&6PlotSquared v" + line + " is available:");
log("&8 - &3Use: &7/plot update"); log("&8 - &3Use: &7/plot update");
log("&8 - &3Or: &7" + dl); log("&8 - &3Or: &7" + dl);
@ -1455,7 +1455,8 @@ public class PS {
return false; return false;
} }
try { try {
File newJar = new File("plugins/update/PlotSquared.jar"); String name = FILE.getName();
File newJar = new File("plugins/update/" + name);
MainUtil.sendMessage(sender, "$1Downloading from provided URL: &7" + url); MainUtil.sendMessage(sender, "$1Downloading from provided URL: &7" + url);
MainUtil.sendMessage(sender, "$2 - User-Agent: " + "Mozilla/4.0"); MainUtil.sendMessage(sender, "$2 - User-Agent: " + "Mozilla/4.0");
URLConnection con = url.openConnection(); URLConnection con = url.openConnection();

Binary file not shown.

Binary file not shown.