mirror of
https://github.com/nix-community/nix-direnv.git
synced 2025-11-08 19:46:11 +01:00
make version check skip less fragile
This commit is contained in:
parent
9d4a2cf0a6
commit
e079c6baa2
2 changed files with 12 additions and 9 deletions
|
|
@ -11,9 +11,9 @@ resholve.mkDerivation rec {
|
||||||
name = pname;
|
name = pname;
|
||||||
};
|
};
|
||||||
|
|
||||||
# drop min version checks which are redundant when built with nix
|
# skip min version checks which are redundant when built with nix
|
||||||
postPatch = ''
|
postPatch = ''
|
||||||
sed -i "/_require_version bash/,+2d" direnvrc
|
sed -i 1iNIX_DIRENV_SKIP_VERSION_CHECK=1 direnvrc
|
||||||
'';
|
'';
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
|
|
|
||||||
17
direnvrc
17
direnvrc
|
|
@ -60,13 +60,16 @@ _nix_direnv_preflight() {
|
||||||
_nix_direnv_fatal '$direnv environment variable was not defined. Was this script run inside direnv?'
|
_nix_direnv_fatal '$direnv environment variable was not defined. Was this script run inside direnv?'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# check command min versions, bash check uses $BASH_VERSION with _require_version
|
# check command min versions
|
||||||
# instead of _require_cmd_version because _require_cmd_version uses =~ operator which
|
if [[ -z ${NIX_DIRENV_SKIP_VERSION_CHECK:-} ]]; then
|
||||||
# would be a syntax error on bash < 3
|
# bash check uses $BASH_VERSION with _require_version instead of
|
||||||
_require_version bash "$BASH_VERSION" "$BASH_MIN_VERSION"
|
# _require_cmd_version because _require_cmd_version uses =~ operator which would be
|
||||||
# direnv stdlib defines $direnv
|
# a syntax error on bash < 3
|
||||||
_require_cmd_version "$direnv" "$DIRENV_MIN_VERSION"
|
_require_version bash "$BASH_VERSION" "$BASH_MIN_VERSION"
|
||||||
_require_cmd_version nix "$NIX_MIN_VERSION"
|
# direnv stdlib defines $direnv
|
||||||
|
_require_cmd_version "$direnv" "$DIRENV_MIN_VERSION"
|
||||||
|
_require_cmd_version nix "$NIX_MIN_VERSION"
|
||||||
|
fi
|
||||||
|
|
||||||
local layout_dir
|
local layout_dir
|
||||||
layout_dir=$(direnv_layout_dir)
|
layout_dir=$(direnv_layout_dir)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue