This commit is contained in:
Wliu 2017-05-30 15:42:16 -04:00
parent 16be073c91
commit 7a93e9d8c4
2 changed files with 7 additions and 8 deletions

View File

@ -1,21 +1,21 @@
const fs = require('fs-extra')
const path = require('path')
module.exports = function(packagePath) {
module.exports = function (packagePath) {
const nodeModulesPath = path.join(packagePath, 'node_modules')
const nodeModulesBackupPath = path.join(packagePath, 'node_modules.bak')
if (fs.existsSync(nodeModulesBackupPath)) {
throw new Error("Cannot back up " + nodeModulesPath + "; " + nodeModulesBackupPath + " already exists")
throw new Error('Cannot back up ' + nodeModulesPath + '; ' + nodeModulesBackupPath + ' already exists')
}
// some packages may have no node_modules after deduping, but we still want
// to "back-up" and later restore that fact
if (!fs.existsSync(nodeModulesPath)) {
const msg = "Skipping backing up " + nodeModulesPath + " as it does not exist"
const msg = 'Skipping backing up ' + nodeModulesPath + ' as it does not exist'
console.log(msg.gray)
const restore = function stubRestoreNodeModules() {
const restore = function stubRestoreNodeModules () {
if (fs.existsSync(nodeModulesPath)) {
fs.removeSync(nodeModulesPath)
}
@ -26,11 +26,11 @@ module.exports = function(packagePath) {
fs.copySync(nodeModulesPath, nodeModulesBackupPath)
const restore = function restoreNodeModules() {
const restore = function restoreNodeModules () {
if (!fs.existsSync(nodeModulesBackupPath)) {
throw new Error("Cannot restore " + nodeModulesPath + "; " + nodeModulesBackupPath + " does not exist")
throw new Error('Cannot restore ' + nodeModulesPath + '; ' + nodeModulesBackupPath + ' does not exist')
}
if (fs.existsSync(nodeModulesPath)) {
fs.removeSync(nodeModulesPath)
}

View File

@ -11,7 +11,6 @@ const runApmInstall = require('./run-apm-install')
require('colors')
module.exports = function () {
console.log(`Transpiling packages with custom transpiler configurations in ${CONFIG.intermediateAppPath}`)
for (let packageName of Object.keys(CONFIG.appMetadata.packageDependencies)) {