aws-sso-cli: enable postInstall of shell completions (#410652)
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
buildGoModule,
|
||||
fetchFromGitHub,
|
||||
getent,
|
||||
installShellFiles,
|
||||
lib,
|
||||
makeWrapper,
|
||||
stdenv,
|
||||
@@ -19,17 +20,27 @@ buildGoModule rec {
|
||||
};
|
||||
vendorHash = "sha256-SNMU7qDfLRGUSLjzrJHtIMgbcRc2DxXwWEUaUEY6PME=";
|
||||
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
nativeBuildInputs = [
|
||||
makeWrapper
|
||||
installShellFiles
|
||||
];
|
||||
|
||||
ldflags = [
|
||||
"-X main.Version=${version}"
|
||||
"-X main.Tag=nixpkgs"
|
||||
];
|
||||
|
||||
postInstall = ''
|
||||
wrapProgram $out/bin/aws-sso \
|
||||
--suffix PATH : ${lib.makeBinPath [ xdg-utils ]}
|
||||
'';
|
||||
postInstall =
|
||||
''
|
||||
wrapProgram $out/bin/aws-sso \
|
||||
--suffix PATH : ${lib.makeBinPath [ xdg-utils ]}
|
||||
''
|
||||
+ lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
|
||||
installShellCompletion --cmd aws-sso \
|
||||
--bash <($out/bin/aws-sso setup completions --source --shell=bash) \
|
||||
--fish <($out/bin/aws-sso setup completions --source --shell=fish) \
|
||||
--zsh <($out/bin/aws-sso setup completions --source --shell=zsh)
|
||||
'';
|
||||
|
||||
nativeCheckInputs = [ getent ];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user