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

Easier rebuild of native modules #643

Merged
merged 6 commits into from
May 16, 2017
Merged

Easier rebuild of native modules #643

merged 6 commits into from
May 16, 2017

Conversation

ffflorian
Copy link
Contributor

@ffflorian ffflorian commented May 16, 2017

  • When we rebuild native modules, we can now set the target architecture with the environment variable wire_target_arch.
  • Updated electron-rebuild.

const normalize = (args) => {
return args.map((arg) => {
Object.keys(process.env).forEach((key) => {
const regex = new RegExp(`\\$${key}|%${key}%`, 'i');
Copy link
Contributor

Choose a reason for hiding this comment

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

More descriptive name for regex. What does it match?

const [command] = normalize(args);
const proc = exec(command, (error, stdout, stderr) => {
if (error) {
console.error(`exec error: ${error}`);
Copy link
Contributor

Choose a reason for hiding this comment

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

It's always good to mention the original error object, like:

console.error(`exec error: ${error}`, error);

const [command] = normalize(args);
const proc = exec(command, (error, stdout, stderr) => {
if (error) {
console.error('Execution error: ', error);
Copy link
Contributor

Choose a reason for hiding this comment

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

no need for colon space (: ) when using multi arguments

console.error('Execution error', error);

Copy link
Contributor Author

@ffflorian ffflorian May 16, 2017

Choose a reason for hiding this comment

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

True, no need for the space - but the colon makes the error message more readable.

@ffflorian ffflorian merged commit 2709a0e into master May 16, 2017
@ffflorian ffflorian deleted the rebuild branch May 16, 2017 13:59
sidneys added a commit to sidneys/wire-desktop that referenced this pull request May 18, 2017
* master:
  New native module rebuilding (wireapp#643)
  Publish amplify events when joining calls (wireapp#629)
  Use new V8 inspector (wireapp#641)
  electron 1.6.9 (wireapp#637)
  Release 2.14.2743
  Add template for github issues
  Update libsodium-neon to 2.1.0 (wireapp#634)
  Update electron-build-env to 0.2.0 (wireapp#633)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants