Unverified Commit a97373a5 authored by h7x4's avatar h7x4 Committed by GitHub
Browse files

azure-cli: install completions for all shells (#346715)

parents 01bb58e3 7e06c84f
Loading
Loading
Loading
Loading
+9 −6
Original line number Diff line number Diff line
@@ -100,7 +100,10 @@ py.pkgs.toPythonApplication (

    sourceRoot = "${src.name}/src/azure-cli";

    nativeBuildInputs = [ installShellFiles ];
    nativeBuildInputs = [
      installShellFiles
      py.pkgs.argcomplete
    ];

    # Dependencies from:
    # https://github.com/Azure/azure-cli/blob/azure-cli-2.62.0/src/azure-cli/setup.py#L52
@@ -221,11 +224,11 @@ py.pkgs.toPythonApplication (
      ++ lib.concatMap (extension: extension.propagatedBuildInputs) withExtensions;

    postInstall =
      ''
        substituteInPlace az.completion.sh \
          --replace-fail register-python-argcomplete ${py.pkgs.argcomplete}/bin/register-python-argcomplete
        installShellCompletion --bash --name az.bash az.completion.sh
        installShellCompletion --zsh --name _az az.completion.sh
      lib.optionalString (stdenvNoCC.buildPlatform.canExecute stdenvNoCC.hostPlatform) ''
        installShellCompletion --cmd az \
          --bash <(register-python-argcomplete az --shell bash) \
          --zsh <(register-python-argcomplete az --shell zsh) \
          --fish <(register-python-argcomplete az --shell fish)
      ''
      + lib.optionalString withImmutableConfig ''
        export HOME=$TMPDIR