gotestwaf: fix version self-reporting
Note: Upstream uses `git describe --tags`, so we have to prefix the version string with the letter `v` just like we do in `src.rev` See https://github.com/wallarm/gotestwaf/blob/6905eb273c44e6f5c25d04ed4ae48ec4d89e7a96/Dockerfile#L50
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
{ lib
|
||||
, buildGoModule
|
||||
, fetchFromGitHub
|
||||
, gotestwaf
|
||||
, testers
|
||||
}:
|
||||
|
||||
buildGoModule rec {
|
||||
@@ -19,11 +21,21 @@ buildGoModule rec {
|
||||
# Some tests require networking as of v0.4.0
|
||||
doCheck = false;
|
||||
|
||||
ldflags = [
|
||||
"-X github.com/wallarm/gotestwaf/internal/version.Version=v${version}"
|
||||
];
|
||||
|
||||
postFixup = ''
|
||||
# Rename binary
|
||||
mv $out/bin/cmd $out/bin/${pname}
|
||||
'';
|
||||
|
||||
passthru.tests.version = testers.testVersion {
|
||||
command = "gotestwaf --version";
|
||||
package = gotestwaf;
|
||||
version = "v${version}";
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
description = "Tool for API and OWASP attack simulation";
|
||||
homepage = "https://github.com/wallarm/gotestwaf";
|
||||
|
||||
Reference in New Issue
Block a user