hyprland-community / Hyprkeys

A simple, scriptable keybind retrieval utility for Hyprland [maintainer=none]
GNU General Public License v3.0
120 stars 6 forks source link

BUG: Wrong version printed by hyprkeys version #13

Closed bloominstrong closed 12 months ago

bloominstrong commented 12 months ago

Calling hyprkeys version gives Hyprkeys: v1.1.0 which has been set in cmd/version.go in release v1.0.2

It could be worth considering something similar to what nebula does in using ldflags to set the Version variable at compile if not already set. this means that the version is automatically picked up when using git.

NotAShelf commented 12 months ago

Good catch! I'll publish a fix by tomorrow, and look into using ldflags afterwards. Seems to be the standard-ish in nixpkgs anyway.

donovanglover commented 12 months ago

Hi @NotAShelf

I'm interested in adding Hyprkeys to nixpkgs and plan to update https://github.com/NixOS/nixpkgs/pull/241201 once the new version comes out.

I'm not sure why, but the current archive returns "the given path has multiple possibilities", thus breaking the build. Maybe it's because the tag was deleted?

bloominstrong commented 12 months ago

@donovanglover,

I think the problem is there is a branch called v1.0.2 . You can reference the tag directly with https://github.com/hyprland-community/Hyprkeys/archive/refs/tags/v1.0.2.tar.gz But I don't know if nix's fetch from GitHub function can specifically use the ref tags address instead

donovanglover commented 12 months ago

Thanks for the hint! PR is now fixed

NotAShelf commented 12 months ago

fetchFromGitHub should be able to fetch the v1.0.2 branch with rev = "v${version$" or similar

NotAShelf commented 12 months ago

p.s. I deleted the v1.0.2 branch, should be easier to do so now

NotAShelf commented 12 months ago

@bloominstrong I've pushed some changes that I think should solve the issue. The version string is now obtained from ldlags in both Makefile and nix builds. I've not tested goreleaser, but it should probably also work. Please let me know if the issue is fixed.

bloominstrong commented 12 months ago

Thank you @NotAShelf , that's working here.