writeShellApplication: fix shellcheck availability check (#362868)

This commit is contained in:
Philip Taron 2024-12-08 13:57:49 -08:00 committed by GitHub
commit 5e0585161b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -299,7 +299,7 @@ rec {
# GHC (=> shellcheck) isn't supported on some platforms (such as risc-v)
# but we still want to use writeShellApplication on those platforms
let
shellcheckSupported = lib.meta.availableOn stdenv.buildPlatform shellcheck-minimal.compiler;
shellcheckSupported = lib.meta.availableOn stdenv.buildPlatform shellcheck-minimal.compiler && (builtins.tryEval shellcheck-minimal.compiler.outPath).success;
excludeFlags = lib.optionals (excludeShellChecks != [ ]) [ "--exclude" (lib.concatStringsSep "," excludeShellChecks) ];
shellcheckCommand = lib.optionalString shellcheckSupported ''
# use shellcheck which does not include docs