Unverified Commit 37253372 authored by h7x4's avatar h7x4 Committed by GitHub
Browse files

treewide: gate command execution for `installShellCompletion` behind...

treewide: gate command execution for `installShellCompletion` behind `buildPlatform.canExecute hostPlatform` (#442353)
parents ee9d4a9e 8bffdd4c
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
{
  lib,
  stdenv,
  buildGoModule,
  fetchFromGitHub,
  installShellFiles,
@@ -45,7 +46,7 @@ let

      doCheck = false;

      postInstall = ''
      postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
        installShellCompletion --cmd kops \
          --bash <($GOPATH/bin/kops completion bash) \
          --fish <($GOPATH/bin/kops completion fish) \
+9 −6
Original line number Diff line number Diff line
{
  lib,
  stdenv,
  fetchFromGitHub,
  buildGoModule,
  coredns,
@@ -40,12 +41,14 @@ buildGoModule rec {
  subPackages = map (p: "app/" + p) components;

  postInstall =
    lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) (
      lib.concatMapStringsSep "\n" (p: ''
        installShellCompletion --cmd ${p} \
          --bash <($out/bin/${p} completion bash) \
          --fish <($out/bin/${p} completion fish) \
          --zsh <($out/bin/${p} completion zsh)
      '') components
    )
    + lib.optionalString isFull ''
      ln -sLf ${coredns}/bin/coredns $out/bin
    '';
+3 −0
Original line number Diff line number Diff line
{
  lib,
  stdenv,
  fetchFromGitHub,
  buildGoModule,
  installShellFiles,
@@ -51,6 +52,8 @@ buildGoModule rec {

  postInstall = ''
    mv $out/bin/cli $out/bin/linkerd
  ''
  + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
    installShellCompletion --cmd linkerd \
      --bash <($out/bin/linkerd completion bash) \
      --zsh <($out/bin/linkerd completion zsh) \
+1 −1
Original line number Diff line number Diff line
@@ -67,7 +67,7 @@ stdenv.mkDerivation {
    runHook postInstall
  '';

  postInstall = ''
  postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
    HOME=$TMPDIR
    installShellCompletion --cmd ${mainProgram} \
      --bash <($out/bin/${mainProgram} completion bash) \
+2 −1
Original line number Diff line number Diff line
{
  lib,
  stdenv,
  buildGoModule,
  fetchFromGitHub,
  installShellFiles,
@@ -27,7 +28,7 @@ buildGoModule rec {
    "-w"
  ];

  postInstall = ''
  postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
    installShellCompletion --cmd abbreviate \
      --bash <($out/bin/abbreviate completion bash) \
      --fish <($out/bin/abbreviate completion fish) \
Loading