Skip to content

Commit

Permalink
feat: only reset deps cache when lock changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ships committed Apr 24, 2024
1 parent 60f437f commit 49d92d9
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,22 @@

shellHook = ''
echo "Setting up default dev shell..."
DEPS_CACHE_TMP="$(mktemp -dt gensql.query.clj.cache.XXXX)"
echo "Copying readonly clojure cache to read-write location at:"
DEPS_CACHE_TMP="/tmp/clojure_cache_gensql_query"
echo "Using read-write clojure cache at:"
echo "$DEPS_CACHE_TMP"
rsync -LrltgoD --chmod=ug+w ${depsCache}/ $DEPS_CACHE_TMP/
cache_signature_file="/tmp/clojure_cache_gensql_query_signature"
cache_signature="$(echo ${depsCache} | tr -d '\n')"
last_cache_signature="$(cat $cache_signature_file | tr -d '\n')"
if [[ $cache_signature != $last_cache_signature ]]; then
echo -n $cache_signature > $cache_signature_file
mkdir -p $DEPS_CACHE_TMP
echo "Copying readonly clojure cache to read-write location"
rsync -LrltgoD --chmod=ug+w ${depsCache}/ $DEPS_CACHE_TMP/
fi
export CLJ_CONFIG="$DEPS_CACHE_TMP/.clojure"
export GITLIBS="$DEPS_CACHE_TMP/.gitlibs"
Expand Down

0 comments on commit 49d92d9

Please sign in to comment.