From c000c30b1b769ae68e1778fa6cad54c40bcd1eec Mon Sep 17 00:00:00 2001 From: Suganya Date: Tue, 26 Jan 2021 14:34:09 +0530 Subject: [PATCH] Avoid generating unwanted file in project directory --- src/main/java/org/ballerinalang/command/util/OSUtils.java | 2 +- src/main/java/org/ballerinalang/command/util/ToolUtil.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/ballerinalang/command/util/OSUtils.java b/src/main/java/org/ballerinalang/command/util/OSUtils.java index 6049f23d..1fb07c4f 100644 --- a/src/main/java/org/ballerinalang/command/util/OSUtils.java +++ b/src/main/java/org/ballerinalang/command/util/OSUtils.java @@ -126,7 +126,7 @@ public static String getInstallerVersionFilePath() throws IOException { ToolUtil.setInstallerVersion(installerVersionfile.getPath()); ToolUtil.setVersion(getBallerinaVersionFilePath(), ToolUtil.getCurrentInstalledBallerinaVersion()); } - return userHome + File.separator + BALLERINA_HOME_DIR + File.separator + INSTALLER_VERSION; + return installerVersionfile.getPath(); } public static String getBallerinaDistListFilePath() { diff --git a/src/main/java/org/ballerinalang/command/util/ToolUtil.java b/src/main/java/org/ballerinalang/command/util/ToolUtil.java index 991d4dd0..e1d583ed 100644 --- a/src/main/java/org/ballerinalang/command/util/ToolUtil.java +++ b/src/main/java/org/ballerinalang/command/util/ToolUtil.java @@ -94,7 +94,7 @@ public static String getCurrentBallerinaVersion() { String installedInstallerVersion = getInstallerVersion(OSUtils.getInstalledInstallerVersionPath()); if (!installedInstallerVersion.equals(getInstallerVersion(installerVersionFilePath))) { setCurrentBallerinaVersion(ToolUtil.getCurrentInstalledBallerinaVersion()); - setInstallerVersion(installedInstallerVersion); + setInstallerVersion(installerVersionFilePath); } } String userVersion = getVersion(OSUtils.getBallerinaVersionFilePath());