Run shellcheck on direnvrc during checkPhase

This commit is contained in:
Bryan Bennett 2024-08-11 12:18:57 -04:00
parent 35dfac9604
commit 3f5f7a602d
No known key found for this signature in database
GPG key ID: EE149E4215408DE9
2 changed files with 8 additions and 1 deletions

View file

@ -11,6 +11,7 @@
, re , re
, reason , reason
, sha , sha
, shellcheck
, upx , upx
, ,
}: }:
@ -38,6 +39,9 @@ buildDunePackage {
# patchELF can't handle UPX'd binaries # patchELF can't handle UPX'd binaries
# We produce a static OCaml binary that # We produce a static OCaml binary that
dontPatchELF = true; dontPatchELF = true;
postCheck = ''
${shellcheck}/bin/shellcheck direnvrc
'';
postPatch = '' postPatch = ''
substituteInPlace direnvrc --replace-fail "@flake_env@" "$out/bin/flake_env" substituteInPlace direnvrc --replace-fail "@flake_env@" "$out/bin/flake_env"
''; '';

View file

@ -1,3 +1,5 @@
#!/usr/bin/env bash
# The below code is taken largely from nix-direnv. # The below code is taken largely from nix-direnv.
# nix-direnv's license is replicated below: # nix-direnv's license is replicated below:
# #
@ -38,7 +40,8 @@ use_flake_env() {
local old_tempdir=${TEMPDIR:-__UNSET__} local old_tempdir=${TEMPDIR:-__UNSET__}
local old_xdg_data_dirs=${XDG_DATA_DIRS:-} local old_xdg_data_dirs=${XDG_DATA_DIRS:-}
local ld=$(direnv_layout_dir) local ld
ld=$(direnv_layout_dir)
export direnv export direnv
local flake_reference="${1:-"."}" local flake_reference="${1:-"."}"