Commit 624d136b authored by Stefan Frijters's avatar Stefan Frijters Committed by Colin
Browse files

go-task: only generate shell completions when possible

parent e9b1bb01
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) \