Skip to content

Commit

Permalink
fix: only set --verbose for node-gyp if DEBUG for rebuild is set
Browse files Browse the repository at this point in the history
Fixes #594.
Closes #689.
  • Loading branch information
malept committed Aug 24, 2021
1 parent a8f7ee0 commit 9cc4840
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/module-type/node-gyp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ export class NodeGyp extends NativeModule {
'--build-from-source'
];

if (process.env.DEBUG) {
args.push('--verbose');
}
args.push(d.enabled ? '--verbose' : '--quiet');

if (this.rebuilder.debug) {
args.push('--debug');
Expand Down Expand Up @@ -115,8 +113,10 @@ export class NodeGyp extends NativeModule {
command = nodeGyp.todo.shift();
}
} catch (err) {
let errorMessage = `node-gyp failed to rebuild '${this.modulePath}'.\n`;
errorMessage += `Error: ${err.message || err}\n\n`;
const errorMessage = `node-gyp failed to rebuild '${this.modulePath}'.
For more information, rerun with the DEBUG environment variable set to "electron-rebuild".
Error: ${err.message || err}\n\n`;
throw new Error(errorMessage);
} finally {
process.chdir(originalWorkingDir);
Expand Down

0 comments on commit 9cc4840

Please sign in to comment.