Skip to content

Commit

Permalink
fix(nodejs): compatible with Windows builds (#183)
Browse files Browse the repository at this point in the history
Signed-off-by: blu3beri <blu3beri@proton.me>
  • Loading branch information
berendsliedrecht authored Apr 28, 2023
1 parent 32f4448 commit 4c54a62
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion wrappers/javascript/indy-vdr-nodejs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"clean": "rimraf -rf ./build",
"compile": "tsc -p tsconfig.build.json",
"test": "jest",
"install": "node-pre-gyp install --target_arch=$(node scripts/arch.js)"
"install": "node-pre-gyp install --target_arch=$(node scripts/arch.js) --target_platform=$(node scripts/platform.js)"
},
"devDependencies": {
"@babel/core": "^7.12.9",
Expand Down
13 changes: 13 additions & 0 deletions wrappers/javascript/indy-vdr-nodejs/scripts/platform.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/* eslint-disable @typescript-eslint/no-var-requires */
/* eslint-disable no-console */
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
/* eslint-disable no-undef */
const os = require('os')

// Find appropriate target architecture for retrieving the anoncreds library
const platform = os.platform()

// We swap win32 with windows as that is the key that we use
const targetPlatform = platform == 'win32' ? 'windows' : platform

console.log(targetPlatform)

0 comments on commit 4c54a62

Please sign in to comment.