Merge pull request #225363 from SuperSandro2000/stern

This commit is contained in:
Artturi 2023-04-15 21:25:01 +03:00 committed by GitHub
commit f59f894b9a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,7 +1,5 @@
{ stdenv, lib, buildPackages, buildGoModule, fetchFromGitHub, installShellFiles }:
let isCrossBuild = stdenv.hostPlatform != stdenv.buildPlatform;
in
buildGoModule rec {
pname = "stern";
version = "1.24.0";
@ -19,12 +17,11 @@ buildGoModule rec {
nativeBuildInputs = [ installShellFiles ];
ldflags =
[ "-s" "-w" "-X github.com/stern/stern/cmd.version=${version}" ];
ldflags = [ "-s" "-w" "-X github.com/stern/stern/cmd.version=${version}" ];
postInstall =
let stern = if isCrossBuild then buildPackages.stern else "$out";
in
postInstall = let
stern = if stdenv.buildPlatform.canExecute stdenv.hostPlatform then "$out" else buildPackages.stern;
in
''
for shell in bash zsh; do
${stern}/bin/stern --completion $shell > stern.$shell