mirror of
https://github.com/nix-community/nix-direnv.git
synced 2025-11-08 19:46:11 +01:00
make condition checks more eye-pleasing
This commit is contained in:
parent
83eb30fbdd
commit
970c00c66c
1 changed files with 13 additions and 11 deletions
24
direnvrc
24
direnvrc
|
|
@ -55,12 +55,13 @@ use_flake() {
|
|||
local profile="$(direnv_layout_dir)/flake-profile"
|
||||
local profile_rc="${profile}.rc"
|
||||
|
||||
if [[ ! -e "$profile" ]] || \
|
||||
[[ ! -e "$profile_rc" ]] || \
|
||||
[[ "$HOME/.direnvrc" -nt "$profile_rc" ]] || \
|
||||
[[ .envrc -nt "$profile_rc" ]] || \
|
||||
[[ flake.nix -nt "$profile_rc" ]] || \
|
||||
[[ flake.lock -nt "$profile_rc" ]];
|
||||
if [[ ! -e "$profile" \
|
||||
|| ! -e "$profile_rc" \
|
||||
|| "$HOME/.direnvrc" -nt "$profile_rc"
|
||||
|| .envrc -nt "$profile_rc"
|
||||
|| flake.nix -nt "$profile_rc"
|
||||
|| flake.lock -nt "$profile_rc"
|
||||
]];
|
||||
then
|
||||
local tmp_profile="$(direnv_layout_dir)/flake-profile.$$"
|
||||
[[ -d "$(direnv_layout_dir)" ]] || mkdir "$(direnv_layout_dir)"
|
||||
|
|
@ -120,11 +121,12 @@ use_nix() {
|
|||
local cache="$direnv_dir/cache-${version:-unknown}"
|
||||
|
||||
local update_drv=0
|
||||
if [[ ! -e "$cache" ]] || \
|
||||
[[ "$HOME/.direnvrc" -nt "$cache" ]] || \
|
||||
[[ .envrc -nt "$cache" ]] || \
|
||||
[[ default.nix -nt "$cache" ]] || \
|
||||
[[ shell.nix -nt "$cache" ]];
|
||||
if [[ ! -e "$cache" \
|
||||
|| "$HOME/.direnvrc" -nt "$cache" \
|
||||
|| .envrc -nt "$cache" \
|
||||
|| default.nix -nt "$cache" \
|
||||
|| shell.nix -nt "$cache" \
|
||||
]];
|
||||
then
|
||||
[[ -d "$direnv_dir" ]] || mkdir "$direnv_dir"
|
||||
local dump_cmd tmp
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue