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