mirror of
https://github.com/CHN-beta/nixpkgs.git
synced 2026-01-12 02:40:31 +08:00
Revert "installShellFiles: add emulator doc for installShellCompletion"
This reverts commit 149a6e0a91.
See discussion in https://github.com/NixOS/nixpkgs/issues/308283 for
more details on why this isn't something we want to suggest.
This commit is contained in:
@@ -99,17 +99,12 @@ failure. To prevent this, guard the completion generation commands.
|
||||
```nix
|
||||
{
|
||||
nativeBuildInputs = [ installShellFiles ];
|
||||
postInstall = lib.optionalString (stdenv.hostPlatform.emulatorAvailable buildPackages) (
|
||||
let
|
||||
emulator = stdenv.hostPlatform.emulator buildPackages;
|
||||
in
|
||||
''
|
||||
# using named fd
|
||||
installShellCompletion --cmd foobar \
|
||||
--bash <(${emulator} $out/bin/foobar --bash-completion) \
|
||||
--fish <(${emulator} $out/bin/foobar --fish-completion) \
|
||||
--zsh <(${emulator} $out/bin/foobar --zsh-completion)
|
||||
''
|
||||
);
|
||||
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
|
||||
# using named fd
|
||||
installShellCompletion --cmd foobar \
|
||||
--bash <($out/bin/foobar --bash-completion) \
|
||||
--fish <($out/bin/foobar --fish-completion) \
|
||||
--zsh <($out/bin/foobar --zsh-completion)
|
||||
'';
|
||||
}
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user