Unverified Commit 69dfebb3 authored by Peder Bergebakken Sundt's avatar Peder Bergebakken Sundt Committed by GitHub
Browse files

dprint: prefer versionCheckHook (#419341)

parents d1ea18d6 bee86124
Loading
Loading
Loading
Loading
+11 −11
Original line number Diff line number Diff line
@@ -4,9 +4,9 @@
  fetchFromGitHub,
  rustPlatform,
  installShellFiles,
  testers,
  writableTmpDirAsHomeHook,
  versionCheckHook,
  nix-update-script,
  dprint,
}:

rustPlatform.buildRustPackage (finalAttrs: {
@@ -62,16 +62,16 @@ rustPlatform.buildRustPackage (finalAttrs: {
        --fish <($out/bin/dprint completions fish)
    '';

  passthru = {
    tests.version = testers.testVersion {
      inherit (finalAttrs) version;

      package = dprint;
      command = ''
        DPRINT_CACHE_DIR="$(mktemp --directory)" dprint --version
      '';
    };
  nativeInstallCheckInputs = [
    writableTmpDirAsHomeHook
    versionCheckHook
  ];
  doInstallCheck = true;
  versionCheckProgram = "${placeholder "out"}/bin/dprint";
  versionCheckProgramArg = "--version";
  versionCheckKeepEnvironment = [ "HOME" ];

  passthru = {
    updateScript = nix-update-script { };
  };