Unverified Commit 6ece1873 authored by Stefan Frijters's avatar Stefan Frijters
Browse files

ov: only generate completions if executable can be run

This fixes cross builds.
parent a0c8d18e
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
{ lib
, stdenv
, buildGoModule
, fetchFromGitHub
, installShellFiles
@@ -38,12 +39,12 @@ buildGoModule rec {

  outputs = [ "out" "doc" ];

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

    '' + ''
    mkdir -p $out/share/$name
    cp $src/ov-less.yaml $out/share/$name/less-config.yaml
    makeWrapper $out/bin/ov $out/bin/ov-less --add-flags "--config $out/share/$name/less-config.yaml"