pulsar/script/bootstrap

38 lines
1.0 KiB
Plaintext
Raw Normal View History

2016-08-02 15:04:45 +03:00
#!/usr/bin/env node
'use strict'
2017-07-19 03:38:04 +03:00
const childProcess = require('child_process')
2017-05-09 16:25:53 +03:00
const CONFIG = require('./config')
const cleanDependencies = require('./lib/clean-dependencies')
const deleteMsbuildFromPath = require('./lib/delete-msbuild-from-path')
const dependenciesFingerprint = require('./lib/dependencies-fingerprint')
2016-08-02 15:04:45 +03:00
const installApm = require('./lib/install-apm')
const runApmInstall = require('./lib/run-apm-install')
2016-08-02 15:04:45 +03:00
const installScriptDependencies = require('./lib/install-script-dependencies')
const verifyMachineRequirements = require('./lib/verify-machine-requirements')
process.on('unhandledRejection', function (e) {
console.error(e.stack || e)
process.exit(1)
})
2016-08-02 15:04:45 +03:00
verifyMachineRequirements()
if (dependenciesFingerprint.isOutdated()) {
cleanDependencies()
}
if (process.platform === 'win32') deleteMsbuildFromPath()
2016-08-02 15:04:45 +03:00
installScriptDependencies()
installApm()
2017-07-19 03:38:04 +03:00
childProcess.execFileSync(
CONFIG.getApmBinPath(),
['--version'],
{stdio: 'inherit'}
)
runApmInstall(CONFIG.repositoryRootPath)
dependenciesFingerprint.write()