3
0

Fix symlink recreation

This commit is contained in:
Prototik 2015-05-31 19:04:51 +07:00
parent 06c15c597d
commit 3defbbe725
2 changed files with 3 additions and 7 deletions

View File

@ -174,9 +174,7 @@ public class KCauldronUpdater implements Runnable {
mSender.sendMessage(ChatColor.RED + "Create symlink " mSender.sendMessage(ChatColor.RED + "Create symlink "
+ ChatColor.GOLD + symlinkPath.getAbsolutePath()); + ChatColor.GOLD + symlinkPath.getAbsolutePath());
} }
if (symlinkPath.exists()) { Files.deleteIfExists(symlinkPath.toPath());
symlinkPath.delete();
}
Files.createSymbolicLink(symlinkPath.toPath(), newPath.toPath()); Files.createSymbolicLink(symlinkPath.toPath(), newPath.toPath());
} }
} catch (Exception e) { } catch (Exception e) {

View File

@ -81,10 +81,8 @@ public class KVersionRetriever implements Runnable, UncaughtExceptionHandler {
JSONObject json = (JSONObject) sParser.parse(new InputStreamReader( JSONObject json = (JSONObject) sParser.parse(new InputStreamReader(
response.getEntity().getContent())); response.getEntity().getContent()));
String version = (String) json.get("version"); String version = (String) json.get("version");
if (DEBUG) {
sLogger.info("Got the latest version: %s", version); sLogger.info("Got the latest version: %s", version);
sLogger.info("Current version is %s", sCurrentVersion); sLogger.info("Current version is %s", sCurrentVersion);
}
if (!sCurrentVersion.equals(version)) { if (!sCurrentVersion.equals(version)) {
mCallback.newVersion(sCurrentVersion, version); mCallback.newVersion(sCurrentVersion, version);
} else { } else {