Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: version of hooks should be displayed #55

Merged
merged 2 commits into from
Jul 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@
@SuppressWarnings("unused")
public class HookManifestUtils {

public static final String BUNDLE_VERSION = "Bundle-Version";
public static final String HOOK_VERSION = "Hook-Version";

public static @Nullable String getHookVersion(@NotNull Class<? extends ActionHook> hookClass) {
try {
Manifest manifest = loadManifestByClass(hookClass);
if (manifest != null) {
Attributes attributes = manifest.getMainAttributes();
return attributes.getValue(BUNDLE_VERSION);
return attributes.getValue(HOOK_VERSION);
} else {
return null;
}
Expand All @@ -41,7 +41,7 @@ public class HookManifestUtils {

if (codeSource != null) {
URL location = codeSource.getLocation();
Path jarPath = Paths.get(location.toURI());
Path jarPath = Paths.get(location.getPath());

if (Files.isRegularFile(jarPath)) {
try (JarFile jarFile = new JarFile(jarPath.toFile())) {
Expand Down
Loading