Skip to content

Commit

Permalink
Define npm_config_jobs env variable in build scripts (atom#21315)
Browse files Browse the repository at this point in the history
Adds the npm_config_jobs env variable across build scripts that may benefit from it (ones that run apm install). This variable is used by node-gyp to compile native code with a number of threads equal to the reported CPU core count
  • Loading branch information
Aerijo authored Jan 22, 2021
1 parent 0008c25 commit 4e1f765
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions script/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ const appName = getAppName(channel);
const executableName = getExecutableName(channel, appName);
const channelName = getChannelName(channel);

// Sets the installation jobs to run maximally in parallel if the user has
// not already configured this. This is applied just by requiring this file.
if (process.env.npm_config_jobs === undefined) {
process.env.npm_config_jobs = 'max';
}

module.exports = {
appMetadata,
apmMetadata,
Expand Down

0 comments on commit 4e1f765

Please sign in to comment.