yara-x: only generate shell completions if possible

This commit is contained in:
Stefan Frijters 2024-07-08 11:33:40 +02:00
parent f32a8ac989
commit 34df1dba45
No known key found for this signature in database
GPG Key ID: 7619A6BC6E7DFA6F

View File

@ -1,4 +1,5 @@
{ lib
, stdenv
, fetchFromGitHub
, rustPlatform
, cmake
@ -22,7 +23,7 @@ rustPlatform.buildRustPackage rec {
nativeBuildInputs = [ cmake installShellFiles ];
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd yr \
--bash <($out/bin/yr completion bash) \
--fish <($out/bin/yr completion fish) \