mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-11-09 23:44:24 +03:00
👕
This commit is contained in:
parent
16be073c91
commit
7a93e9d8c4
@ -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)
|
||||
}
|
||||
|
@ -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)) {
|
||||
|
Loading…
Reference in New Issue
Block a user