Skip to content

Commit

Permalink
Don't rely on test_dependencies to assume that package-lock.json exists.
Browse files Browse the repository at this point in the history
  • Loading branch information
bakhtiyarneyman committed Feb 2, 2024
1 parent 95b06ed commit 2f7a946
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions nix/build-spago-lock.nix
Original file line number Diff line number Diff line change
Expand Up @@ -328,8 +328,15 @@
purs compile ${lib.concatStringsSep " " testGlobs} --codegen js 2>&1
set +f
echo "Symlinking node modules..."
ln -s ${npmDependencies}/js/node_modules .
${
# Only simplink if the package-lock.json existsts.
if builtins.pathExists "${src}/package-lock.json"
then ''
echo "Symlinking node modules..."
ln -s ${npmDependencies}/js/node_modules .
''
else "echo 'No package-lock.json found in ${src}. Skipping symlinking.'"
}
# Generate test_entrypoint.mjs.
echo "import { main } from './output/Test.Main/index.js'; main();" > test_entrypoint.mjs
Expand Down

0 comments on commit 2f7a946

Please sign in to comment.