Compare commits

...

7 Commits

Author SHA1 Message Date
hyperdefined
71f3a3ea10 Update ToolStats.java 2025-03-27 22:01:54 -04:00
hyperdefined
3f850aaef7 Merge pull request #96 from sebampuero/fix-unhandled-githubrelease-exception
Fix: catch unhandled exception when version does not exist yet
2025-03-27 21:49:04 -04:00
hyperdefined
427628da6e Merge pull request #92 from hyperdefined/dependabot/maven/org.apache.maven.plugins-maven-clean-plugin-3.4.1
Bump org.apache.maven.plugins:maven-clean-plugin from 3.4.0 to 3.4.1
2025-03-27 21:45:30 -04:00
hyperdefined
820c1dce51 Merge pull request #93 from hyperdefined/dependabot/maven/org.apache.maven.plugins-maven-compiler-plugin-3.14.0
Bump org.apache.maven.plugins:maven-compiler-plugin from 3.13.0 to 3.14.0
2025-03-27 21:44:10 -04:00
sebampuero
ad1a4fe26e fix: catch unhandled exception when version does not exist yet 2025-03-15 16:00:00 +01:00
dependabot[bot]
ceb1dbd297 Bump org.apache.maven.plugins:maven-compiler-plugin
Bumps [org.apache.maven.plugins:maven-compiler-plugin](https://github.com/apache/maven-compiler-plugin) from 3.13.0 to 3.14.0.
- [Release notes](https://github.com/apache/maven-compiler-plugin/releases)
- [Commits](https://github.com/apache/maven-compiler-plugin/compare/maven-compiler-plugin-3.13.0...maven-compiler-plugin-3.14.0)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-compiler-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-21 11:03:35 +00:00
dependabot[bot]
49f4727100 Bump org.apache.maven.plugins:maven-clean-plugin from 3.4.0 to 3.4.1
Bumps [org.apache.maven.plugins:maven-clean-plugin](https://github.com/apache/maven-clean-plugin) from 3.4.0 to 3.4.1.
- [Release notes](https://github.com/apache/maven-clean-plugin/releases)
- [Commits](https://github.com/apache/maven-clean-plugin/compare/maven-clean-plugin-3.4.0...maven-clean-plugin-3.4.1)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-clean-plugin
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-19 12:50:38 +00:00
2 changed files with 9 additions and 6 deletions

View File

@@ -23,7 +23,7 @@
<groupId>lol.hyper</groupId> <groupId>lol.hyper</groupId>
<artifactId>toolstats</artifactId> <artifactId>toolstats</artifactId>
<version>1.9.2-hotfix-2</version> <version>1.9.3</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>ToolStats</name> <name>ToolStats</name>
@@ -37,7 +37,7 @@
<plugins> <plugins>
<plugin> <plugin>
<artifactId>maven-clean-plugin</artifactId> <artifactId>maven-clean-plugin</artifactId>
<version>3.4.0</version> <version>3.4.1</version>
<executions> <executions>
<execution> <execution>
<id>auto-clean</id> <id>auto-clean</id>
@@ -51,7 +51,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>3.13.0</version> <version>3.14.0</version>
<configuration> <configuration>
<source>${java.version}</source> <source>${java.version}</source>
<target>${java.version}</target> <target>${java.version}</target>

View File

@@ -19,6 +19,7 @@ package lol.hyper.toolstats;
import lol.hyper.githubreleaseapi.GitHubRelease; import lol.hyper.githubreleaseapi.GitHubRelease;
import lol.hyper.githubreleaseapi.GitHubReleaseAPI; import lol.hyper.githubreleaseapi.GitHubReleaseAPI;
import lol.hyper.githubreleaseapi.ReleaseNotFoundException;
import lol.hyper.toolstats.commands.CommandToolStats; import lol.hyper.toolstats.commands.CommandToolStats;
import lol.hyper.toolstats.events.*; import lol.hyper.toolstats.events.*;
import lol.hyper.toolstats.tools.*; import lol.hyper.toolstats.tools.*;
@@ -251,12 +252,14 @@ public final class ToolStats extends JavaPlugin {
e.printStackTrace(); e.printStackTrace();
return; return;
} }
GitHubRelease current = api.getReleaseByTag(this.getPluginMeta().getVersion()); GitHubRelease current;
GitHubRelease latest = api.getLatestVersion(); try {
if (current == null) { current = api.getReleaseByTag(this.getPluginMeta().getVersion());
} catch (ReleaseNotFoundException e) {
logger.warning("You are running a version that does not exist on GitHub. If you are in a dev environment, you can ignore this. Otherwise, this is a bug!"); logger.warning("You are running a version that does not exist on GitHub. If you are in a dev environment, you can ignore this. Otherwise, this is a bug!");
return; return;
} }
GitHubRelease latest = api.getLatestVersion();
int buildsBehind = api.getBuildsBehind(current); int buildsBehind = api.getBuildsBehind(current);
if (buildsBehind == 0) { if (buildsBehind == 0) {
logger.info("You are running the latest version."); logger.info("You are running the latest version.");