Compare commits

..

2 Commits

Author SHA1 Message Date
20b2dfac7c Always recreate recipe by evaluating .envrc
evaluating .envrc (not the cached section) should not be expensive
2019-12-12 15:30:30 +01:00
Lukas Schuller
da4b0586e5 Add some logging 2019-12-09 14:40:17 +01:00
2 changed files with 3 additions and 23 deletions

View File

@@ -1,9 +1,4 @@
{ stdenv
, direnv
, term-test ? null
, doCheck ? true
}:
assert doCheck -> term-test != null;
{ stdenv, direnv, term-test }:
stdenv.mkDerivation {
name = "direnv-cache";
@@ -13,7 +8,6 @@ stdenv.mkDerivation {
make install PREFIX=$out
'';
checkInputs = [ term-test ];
inherit doCheck;
doCheck = true;
passthru = { direnvrc = ./direnvrc; };
preferLocalBuild = true;
}

View File

@@ -70,23 +70,9 @@ getCacheFilePath() {
echo "${cacheDir}/$(pwd | sha1sum | tr -d ' -')"
}
switchToDirenvDir() {
# Find directory that contains the current .envrc. Allows direnv-cache to
# be called from subdirectories.
wd="$(pwd)"
if [[ -n $DIRENV_DIR ]]; then
wd="${DIRENV_DIR#-}"
fi
cd "$wd"
}
cmd="$1"
switchToDirenvDir
if ! [[ -e ".envrc" ]]; then
if ! [[ -e .envrc ]]; then
echo "Error, no .envrc found in current directory"
exit 1
fi