Skip to content

Commit

Permalink
Change default version to 0.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
NipunaMadhushan committed Aug 22, 2024
1 parent 544403c commit deaff8e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/main/java/org/ballerinalang/command/util/ToolUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,12 @@ public static String getCurrentBallerinaVersion() {
setInstallerVersion(installerVersionFilePath);
}
}
String ballerinaVersionFilePath = OSUtils.getBallerinaVersionFilePath();
if (!new File(ballerinaVersionFilePath).exists()) {
String defaultBallerinaVersion = "0.0.0";
setCurrentBallerinaVersion(defaultBallerinaVersion);
setInstallerVersion(installerVersionFilePath);
}
String userVersion = getVersion(OSUtils.getBallerinaVersionFilePath());
if (checkDistributionAvailable(userVersion)) {
return userVersion;
Expand All @@ -113,7 +119,7 @@ public static String getCurrentInstalledBallerinaVersion() {
return getVersion(OSUtils.getInstalledConfigPath());
} catch (IOException e) {
//If we files does not exist it will be empty and update tool continues without a distribution
return "";
return "0.0.0";
}
}

Expand Down Expand Up @@ -701,7 +707,7 @@ private static void downloadAndSetupDependency(HttpURLConnection conn, PrintStre
zipFile.delete();
}
}

public static void removeUnusedDependencies(String distributionVersion, PrintStream printStream) {
String dependencyForDistribution = "";
String channelForDistribution = "";
Expand Down

0 comments on commit deaff8e

Please sign in to comment.