Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix armv7l install by using `arch' #58

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const fetch = require('make-fetch-happen').defaults({
const VError = require('verror')
const rimraf = util.promisify(require('rimraf'))
const zlib = require('zlib')
const { spawn } = require('child_process')
const { spawn, execSync } = require('child_process')
const yargs = require('yargs')
const pump = util.promisify(require('pump'))
const debug = require('util').debuglog('node-bin-gen')
Expand Down Expand Up @@ -47,6 +47,16 @@ const version = (versionprime[0] != 'v') ? 'v' + versionprime : version
async function buildArchPackage(os, cpu, version, pre) {
debug("building architecture specific package", os, cpu, version, pre)

var actualCpu = cpu;

if (cpu === 'arm') {
const armCpu = execSync('arch')
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is the right place for this though: this is the download script, not installArchSpecific. This always just runs on my laptop.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


if (typeof armCpu !== 'undefined' && armCpu.toString().trim().length > 0) {
actualCpu = armCpu.toString().trim()
}
}

const platform = os == 'win' ? 'win32' : os
const arch = os == 'win' && cpu == 'ia32' ? 'x86' : cpu
const executable = os == 'win' ? 'bin/node.exe' : 'bin/node'
Expand Down