reuse intermediate deno caches

This commit is contained in:
EatThePooh 2025-08-03 14:09:30 +07:00
parent f459ec8b78
commit 60b5164a8a
9 changed files with 146 additions and 117 deletions

View file

@ -0,0 +1,19 @@
{ self }:
{ pkgs, sharedCache }:
pkgs.writeShellScript "deno-shelf-setup" ''
export DENO_DIR=$PWD/.deno_cache
if [ ! -d "$DENO_DIR" ] || [ "${sharedCache}" -nt "$DENO_DIR/.cache_timestamp" ]; then
echo "Setting up shared Deno cache..."
rm -rf "$DENO_DIR"
cp -r "${sharedCache}" "$DENO_DIR"
chmod -R u+w "$DENO_DIR"
touch "$DENO_DIR/.cache_timestamp"
echo "Shared Deno cache initialized"
else
echo "Deno cache is up to date"
fi
''