fix DENO_DIR

This commit is contained in:
EatThePooh 2025-08-03 15:43:09 +07:00
parent 792131097c
commit a25bb5d1ca
4 changed files with 10 additions and 4 deletions

View file

@ -29,6 +29,8 @@ pkgs.stdenv.mkDerivation {
else "${scroll.name}-incremental-cache";
src = scrollsDir;
passAsFile = [ "knownHashesJson" ];
knownHashesJson = builtins.toJSON scroll.build.knownHashes;
nativeBuildInputs = [ pkgs.deno pkgs.jq ];
dontPatchShebangs = true;

View file

@ -1,11 +1,14 @@
{ self }:
{ pkgs, sharedCache }:
pkgs.writeShellScript "deno-shelf-setup" ''
export DENO_DIR=$PWD/.deno_cache
# DENO_DIR should be set by the caller
if [ -z "$DENO_DIR" ]; then
echo "Error: DENO_DIR environment variable must be set"
exit 1
fi
if [ ! -d "$DENO_DIR" ] || [ "${sharedCache}" -nt "$DENO_DIR/.cache_timestamp" ]; then
echo "Setting up shared Deno cache..."
echo "Setting up shared Deno cache in $DENO_DIR..."
rm -rf "$DENO_DIR"
cp -r "${sharedCache}" "$DENO_DIR"