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

@ -21,6 +21,7 @@
devShells.default = pkgs.mkShell { devShells.default = pkgs.mkShell {
buildInputs = [ pkgs.deno ]; buildInputs = [ pkgs.deno ];
shellHook = '' shellHook = ''
export DENO_DIR=$PWD/.deno_cache
${shelf.setupScript} ${shelf.setupScript}
echo "Availabe scrolls:" echo "Availabe scrolls:"

View file

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

View file

@ -1,11 +1,14 @@
{ self }: { self }:
{ pkgs, sharedCache }: { pkgs, sharedCache }:
pkgs.writeShellScript "deno-shelf-setup" '' 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 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" rm -rf "$DENO_DIR"
cp -r "${sharedCache}" "$DENO_DIR" cp -r "${sharedCache}" "$DENO_DIR"

View file

@ -26,7 +26,7 @@
cacheCommand = "deno cache --frozen main.ts"; cacheCommand = "deno cache --frozen main.ts";
knownHashes = { knownHashes = {
"sha1-gSeoE0sSj+dFQ7SUoyaQV0X/KJE=" = "sha1-gSeoE0sSj+dFQ7SUoyaQV0X/KJE=" =
"sha256-0ZfdWVfShbhgAoSse9vEpFPRh5XTTVjgxGMmezwon9I="; "sha256-0ZfdWVfShbhgAoSse9vEpFPRh5XTTVjgxGMmezwon1I=";
}; };
}; };
} }