amber-lang: generate bash completion
This commit is contained in:
@@ -5,6 +5,8 @@
|
||||
bc,
|
||||
util-linux,
|
||||
makeWrapper,
|
||||
installShellFiles,
|
||||
stdenv,
|
||||
runCommand,
|
||||
amber-lang,
|
||||
nix-update-script,
|
||||
@@ -29,7 +31,10 @@ rustPlatform.buildRustPackage rec {
|
||||
--replace-fail 'Command::new("/usr/bin/env")' 'Command::new("env")'
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
nativeBuildInputs = [
|
||||
makeWrapper
|
||||
installShellFiles
|
||||
];
|
||||
|
||||
nativeCheckInputs = [
|
||||
bc
|
||||
@@ -43,9 +48,14 @@ rustPlatform.buildRustPackage rec {
|
||||
"--skip=tests::formatter::all_exist"
|
||||
];
|
||||
|
||||
postInstall = ''
|
||||
wrapProgram "$out/bin/amber" --prefix PATH : "${lib.makeBinPath [ bc ]}"
|
||||
'';
|
||||
postInstall =
|
||||
''
|
||||
wrapProgram "$out/bin/amber" --prefix PATH : "${lib.makeBinPath [ bc ]}"
|
||||
''
|
||||
+ lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
|
||||
installShellCompletion --cmd amber \
|
||||
--bash <($out/bin/amber completion)
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
updateScript = nix-update-script { };
|
||||
|
||||
Reference in New Issue
Block a user