Skip to content

Commit

Permalink
Fix native module packaging for Windows
Browse files Browse the repository at this point in the history
Closes #4
  • Loading branch information
kylecarbs committed Oct 13, 2024
1 parent 108928d commit 75f725c
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,17 @@
cp -R ${cursorSrc}/resources/app/*.json ${root}/resources/app/
cp -R ${cursorSrc}/resources/app/extensions/cursor-* ${root}/resources/app/extensions/
rm -rf "${root}/resources/app/node_modules"{,.asar}
cp -R ${cursorSrc}/resources/app/node_modules.asar ${root}/resources/app/
# Unpack the Cursor node_modules.asar
${pkgs.asar}/bin/asar extract ${cursorSrc}/resources/app/node_modules.asar ${root}/resources/app/node_modules
# Copy the VS Code native modules into the Cursor node_modules.
# If we don't do this, then native modules will fail.
# See: https://github.com/coder/cursor-arm/issues/4
cp -R ${root}/resources/app/node_modules.asar.unpacked/* ${root}/resources/app/node_modules/
# Repackage the combined contents into a new node_modules.asar
${pkgs.asar}/bin/asar pack ${root}/resources/app/node_modules ${root}/resources/app/node_modules.asar
rm -rf "${root}/resources/app/node_modules"{,.asar.unpacked}
rm -rf ${root}/resources/app/resources
cp -R ${cursorSrc}/resources/app/resources ${root}/resources/app/
'';
Expand Down

0 comments on commit 75f725c

Please sign in to comment.