Skip to content

Commit

Permalink
Make npm scripts for nsventforwarder respect CARGO_TARGET_DIR
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkusPettersson98 committed Nov 21, 2024
1 parent a0808d5 commit 9bf0ae7
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion desktop/packages/mullvad-vpn/tasks/distribution.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const config = {
'node_modules/',
'!node_modules/grpc-tools',
'!node_modules/@types',
'!node_modules/nseventforwarder/target',
'!node_modules/nseventforwarder/debug',
],

// Make sure that all files declared in "extraResources" exists and abort if they don't.
Expand Down
1 change: 1 addition & 0 deletions desktop/packages/nseventforwarder/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ npm-debug.log*
lib
*.log
dist/
debug/
7 changes: 4 additions & 3 deletions desktop/packages/nseventforwarder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
"main": "./lib/index.cjs",
"scripts": {
"cargo-build": "tsc && cargo build",
"build-debug": "npm run cargo-build && cp target/debug/libnseventforwarder.dylib target/debug/index.node",
"build-arm": "npm run cargo-build -- --release --target aarch64-apple-darwin && mkdir -p dist/darwin-arm64 && cp ../../../target/aarch64-apple-darwin/release/libnseventforwarder.dylib dist/darwin-arm64/index.node",
"build-x86": "npm run cargo-build -- --release --target x86_64-apple-darwin && mkdir -p dist/darwin-x64 && cp ../../../target/x86_64-apple-darwin/release/libnseventforwarder.dylib dist/darwin-x64/index.node",
"build-debug": "npm run cargo-build && mkdir -p debug && cp ${CARGO_TARGET_DIR:-../../../target}/debug/libnseventforwarder.dylib debug/index.node",
"build-arm": "npm run cargo-build -- --release --target aarch64-apple-darwin && mkdir -p dist/darwin-arm64 && cp ${CARGO_TARGET_DIR:-../../../target}/aarch64-apple-darwin/release/libnseventforwarder.dylib dist/darwin-arm64/index.node",
"build-x86": "npm run cargo-build -- --release --target x86_64-apple-darwin && mkdir -p dist/darwin-x64 && cp ${CARGO_TARGET_DIR:--../../../target}/x86_64-apple-darwin/release/libnseventforwarder.dylib dist/darwin-x64/index.node",
"clean": "rm -rf debug; rm -rf dist",
"lint": "eslint .",
"lint-fix": "eslint --fix ."
},
Expand Down
2 changes: 1 addition & 1 deletion desktop/packages/nseventforwarder/src/load.cts
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ module.exports = require('@neon-rs/load').proxy({
'darwin-x64': () => require('../dist/darwin-x64'),
'darwin-arm64': () => require('../dist/darwin-arm64'),
},
debug: () => require('../target/debug/index.node'),
debug: () => require('../debug/index.node'),
});

0 comments on commit 9bf0ae7

Please sign in to comment.