Unverified Commit 6572a49f authored by Cody P Schafer's avatar Cody P Schafer
Browse files

natscli: set `main.version=${version}`

Otherwise, `natscli --version` reports its version as "development"
instead of the version number.

Adds versionCheckHook to verify.
parent f1f3b5ec
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
{ lib
, buildGoModule
, fetchFromGitHub
, versionCheckHook
}:

buildGoModule rec {
@@ -16,6 +17,14 @@ buildGoModule rec {

  vendorHash = "sha256-T6VcyklwfRS012ZRzqxkahn9YYrQGky/znTqLIkAoK0=";

  ldflags = [
    "-X main.version=${version}"
  ];

  nativeInstallCheckInputs = [ versionCheckHook ];
  doInstallCheck = true;
  versionCheckProgram = "${placeholder "out"}/bin/nats";

  meta = with lib; {
    description = "NATS Command Line Interface";
    homepage = "https://github.com/nats-io/natscli";