mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Extract backup-node-modules.js
This commit is contained in:
@@ -11,6 +11,7 @@ const glob = require('glob')
|
||||
const path = require('path')
|
||||
|
||||
const CONFIG = require('./config')
|
||||
const backupNodeModules = require('./lib/backup-node-modules')
|
||||
const runApmInstall = require('./lib/run-apm-install')
|
||||
|
||||
const resourcePath = CONFIG.repositoryRootPath
|
||||
@@ -94,11 +95,7 @@ for (let packageName in CONFIG.appMetadata.packageDependencies) {
|
||||
if (require(pkgJsonPath).atomTestRunner) {
|
||||
console.log(`Installing test runner dependencies for ${packageName}`.bold.green)
|
||||
if (fs.existsSync(nodeModulesPath)) {
|
||||
fs.copySync(nodeModulesPath, nodeModulesBackupPath)
|
||||
finalize = () => {
|
||||
fs.removeSync(nodeModulesPath)
|
||||
fs.renameSync(nodeModulesBackupPath, nodeModulesPath)
|
||||
}
|
||||
finalize = backupNodeModules(repositoryPackagePath)
|
||||
} else {
|
||||
finalize = () => fs.removeSync(nodeModulesPath)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user