mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-10 11:45:45 +03:00
installShellFiles: add emulator doc for installShellCompletion
This commit is contained in:
parent
d524147f47
commit
149a6e0a91
1 changed files with 12 additions and 7 deletions
|
@ -99,12 +99,17 @@ failure. To prevent this, guard the completion generation commands.
|
||||||
```nix
|
```nix
|
||||||
{
|
{
|
||||||
nativeBuildInputs = [ installShellFiles ];
|
nativeBuildInputs = [ installShellFiles ];
|
||||||
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
|
postInstall = lib.optionalString (stdenv.hostPlatform.emulatorAvailable buildPackages) (
|
||||||
|
let
|
||||||
|
emulator = stdenv.hostPlatform.emulator buildPackages;
|
||||||
|
in
|
||||||
|
''
|
||||||
# using named fd
|
# using named fd
|
||||||
installShellCompletion --cmd foobar \
|
installShellCompletion --cmd foobar \
|
||||||
--bash <($out/bin/foobar --bash-completion) \
|
--bash <(${emulator} $out/bin/foobar --bash-completion) \
|
||||||
--fish <($out/bin/foobar --fish-completion) \
|
--fish <(${emulator} $out/bin/foobar --fish-completion) \
|
||||||
--zsh <($out/bin/foobar --zsh-completion)
|
--zsh <(${emulator} $out/bin/foobar --zsh-completion)
|
||||||
'';
|
''
|
||||||
|
);
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue