Skip to content

Commit 0200335

Browse files
committed
bitwarden-cli: add zsh completion
1 parent 69428d2 commit 0200335

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

pkgs/by-name/bi/bitwarden-cli/package.nix

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,16 @@ buildNpmPackage rec {
7474
shopt -u globstar
7575
'';
7676

77-
postInstall = ''
78-
# The @bitwarden modules are actually npm workspaces inside the source tree, which
79-
# leave dangling symlinks behind. They can be safely removed, because their source is
80-
# bundled via webpack and thus not needed at run-time.
81-
rm -rf $out/lib/node_modules/@bitwarden/clients/node_modules/{@bitwarden,.bin}
82-
'';
77+
postInstall =
78+
''
79+
# The @bitwarden modules are actually npm workspaces inside the source tree, which
80+
# leave dangling symlinks behind. They can be safely removed, because their source is
81+
# bundled via webpack and thus not needed at run-time.
82+
rm -rf $out/lib/node_modules/@bitwarden/clients/node_modules/{@bitwarden,.bin}
83+
''
84+
+ lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
85+
installShellCompletion --cmd bw --zsh <($out/bin/bw completion --shell zsh)
86+
'';
8387

8488
passthru = {
8589
tests = {

0 commit comments

Comments
 (0)