mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-20 15:37:46 +03:00
25 lines
852 B
JavaScript
25 lines
852 B
JavaScript
'use strict'
|
|
|
|
const childProcess = require('child_process')
|
|
const path = require('path')
|
|
|
|
const CONFIG = require('../config')
|
|
|
|
module.exports = function () {
|
|
const installEnv = Object.assign({}, process.env)
|
|
// Set resource path so that apm can load metadata related to Atom.
|
|
installEnv.ATOM_RESOURCE_PATH = CONFIG.repositoryRootPath
|
|
// Set our target (Electron) version so that node-pre-gyp can download the
|
|
// proper binaries.
|
|
installEnv.npm_config_target = CONFIG.appMetadata.electronVersion;
|
|
// Force 32-bit modules on Windows. (Ref.: https://github.com/atom/atom/issues/10450)
|
|
if (process.platform === 'win32') {
|
|
installEnv.npm_config_target_arch = 'ia32'
|
|
}
|
|
childProcess.execFileSync(
|
|
CONFIG.apmBinPath,
|
|
['--loglevel=error', 'install'],
|
|
{env: installEnv, cwd: CONFIG.repositoryRootPath, stdio: 'inherit'}
|
|
)
|
|
}
|