Unverified Commit 9b8c09eb authored by Colin's avatar Colin Committed by GitHub
Browse files

go-task: fix cross by only generating shell completions when possible (#372797)

parents 435a03e4 624d136b
Loading
Loading
Loading
Loading
+19 −15
Original line number Diff line number Diff line
{ lib
, buildGoModule
, fetchFromGitHub
, installShellFiles
, testers
, nix-update-script
, go-task
{
  lib,
  stdenv,
  buildGoModule,
  fetchFromGitHub,
  installShellFiles,
  testers,
  nix-update-script,
  go-task,
}:

buildGoModule rec {
@@ -34,9 +36,11 @@ buildGoModule rec {

  env.CGO_ENABLED = 0;

  postInstall = ''
  postInstall =
    ''
      ln -s $out/bin/task $out/bin/go-task

    ''
    + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
      installShellCompletion --cmd task \
        --bash <($out/bin/task --completion bash) \
        --fish <($out/bin/task --completion fish) \