Merge pull request #316691 from superherointj/nodejs-add-bash-completion
nodejs: add bash shell completion
This commit is contained in:
commit
60f8a6cf20
@ -7,6 +7,7 @@
|
||||
, gnupg
|
||||
, darwin, xcbuild
|
||||
, procps, icu
|
||||
, installShellFiles
|
||||
}:
|
||||
|
||||
{ enableNpm ? true, version, sha256, patches ? [] } @args:
|
||||
@ -69,7 +70,7 @@ let
|
||||
buildInputs = lib.optionals stdenv.isDarwin [ CoreServices ApplicationServices ]
|
||||
++ [ zlib libuv openssl http-parser icu bash ];
|
||||
|
||||
nativeBuildInputs = [ which pkg-config python ]
|
||||
nativeBuildInputs = [ installShellFiles pkg-config python which ]
|
||||
++ lib.optionals stdenv.isDarwin [ xcbuild ];
|
||||
|
||||
outputs = [ "out" "libv8" ];
|
||||
@ -151,6 +152,11 @@ let
|
||||
postInstall = ''
|
||||
HOST_PATH=$out/bin patchShebangs --host $out
|
||||
|
||||
${lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
|
||||
$out/bin/${self.meta.mainProgram} --completion-bash > ${self.meta.mainProgram}.bash
|
||||
installShellCompletion ${self.meta.mainProgram}.bash
|
||||
''}
|
||||
|
||||
${lib.optionalString (enableNpm) ''
|
||||
mkdir -p $out/share/bash-completion/completions
|
||||
ln -s $out/lib/node_modules/npm/lib/utils/completion.sh \
|
||||
|
Loading…
Reference in New Issue
Block a user