Skip to content

Commit

Permalink
change download url for prebuilt iohook and added arm64 support
Browse files Browse the repository at this point in the history
  • Loading branch information
nexuslifeline committed Apr 5, 2023
1 parent 3442b24 commit 4f62acf
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
11 changes: 9 additions & 2 deletions install.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function install(runtime, abi, platform, arch, cb) {

console.log('Downloading prebuild for platform:', currentPlatform);
let downloadUrl =
'https://github.com/wilix-team/iohook/releases/download/v' +
'https://github.com/hiredigital/iohook/releases/download/v' +
pkgVersion +
'/' +
currentPlatform +
Expand Down Expand Up @@ -116,7 +116,7 @@ if (process.env.npm_config_targets) {
if (process.env.npm_config_targets === 'all') {
options.targets = supportedTargets.map((arr) => [arr[0], arr[2]]);
options.platforms = ['win32', 'darwin', 'linux'];
options.arches = ['x64', 'ia32'];
options.arches = ['x64', 'ia32', 'arm64'];
}
if (process.env.npm_config_platforms) {
options.platforms = options.platforms.concat(
Expand All @@ -129,6 +129,10 @@ if (process.env.npm_config_arches) {
);
}

if (!options.arches.includes('arm64')) {
options.arches.push('arm64');
}

// Choice prebuilds for install
if (options.targets.length > 0) {
let chain = Promise.resolve();
Expand Down Expand Up @@ -156,6 +160,9 @@ if (options.targets.length > 0) {
if (platform === 'darwin' && arch === 'ia32') {
return;
}
if (platform !== 'darwin' && arch === 'arm64') {
return;
}
chain = chain.then(function () {
return new Promise(function (resolve) {
console.log(runtime, abi, platform, arch);
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "iohook",
"version": "0.9.3",
"version": "0.9.4",
"description": "Node.js global keyboard and mouse hook",
"author": "Aloyan Dmitry",
"license": "MIT",
Expand Down

0 comments on commit 4f62acf

Please sign in to comment.