dprint: add shell completions (#362139)
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
stdenv,
|
||||
fetchCrate,
|
||||
rustPlatform,
|
||||
installShellFiles,
|
||||
testers,
|
||||
nix-update-script,
|
||||
dprint,
|
||||
@@ -23,6 +24,18 @@ rustPlatform.buildRustPackage rec {
|
||||
# every commit upstream on GitHub Actions
|
||||
doCheck = false;
|
||||
|
||||
nativeBuildInputs = lib.optionals (stdenv.buildPlatform.canExecute stdenv.hostPlatform) [
|
||||
installShellFiles
|
||||
];
|
||||
|
||||
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
|
||||
export DPRINT_CACHE_DIR="$(mktemp -d)"
|
||||
installShellCompletion --cmd dprint \
|
||||
--bash <($out/bin/dprint completions bash) \
|
||||
--zsh <($out/bin/dprint completions zsh) \
|
||||
--fish <($out/bin/dprint completions fish)
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
tests.version = testers.testVersion {
|
||||
inherit version;
|
||||
|
||||
Reference in New Issue
Block a user