mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-11 11:15:24 +03:00
parallelize clean
This commit is contained in:
parent
619ec1059f
commit
609f2236ec
@ -26,13 +26,12 @@ if (!ci && process.env.CI === 'true' && process.argv.indexOf('--no-ci') === -1)
|
||||
|
||||
verifyMachineRequirements(ci)
|
||||
|
||||
if (dependenciesFingerprint.isOutdated()) {
|
||||
cleanDependencies()
|
||||
}
|
||||
|
||||
if (process.platform === 'win32') deleteMsbuildFromPath()
|
||||
|
||||
async function bootstrap() {
|
||||
if (dependenciesFingerprint.isOutdated()) {
|
||||
await cleanDependencies()
|
||||
}
|
||||
|
||||
if (process.platform === 'win32') deleteMsbuildFromPath()
|
||||
|
||||
installScriptRunnerDependencies()
|
||||
|
||||
|
@ -160,7 +160,7 @@ async function build() {
|
||||
|
||||
if (!argv.existingBinaries) {
|
||||
checkChromedriverVersion()
|
||||
cleanOutputDirectory()
|
||||
await cleanOutputDirectory()
|
||||
await copyAssets()
|
||||
await transpile()
|
||||
generateModuleCache()
|
||||
|
14
script/clean
14
script/clean
@ -7,7 +7,13 @@ const cleanDependencies = require('./lib/clean-dependencies')
|
||||
const cleanOutputDirectory = require('./lib/clean-output-directory')
|
||||
const killRunningAtomInstances = require('./lib/kill-running-atom-instances')
|
||||
|
||||
killRunningAtomInstances()
|
||||
cleanDependencies()
|
||||
cleanCaches()
|
||||
cleanOutputDirectory()
|
||||
async function clean() {
|
||||
killRunningAtomInstances()
|
||||
return Promise.all([
|
||||
cleanDependencies(),
|
||||
cleanCaches(),
|
||||
cleanOutputDirectory()
|
||||
])
|
||||
}
|
||||
|
||||
clean().then(() => {process.exit(0)}).catch((e) => {throw e;})
|
||||
|
@ -20,9 +20,11 @@ module.exports = function() {
|
||||
path.join(os.tmpdir(), 'atom-build'),
|
||||
path.join(os.tmpdir(), 'atom-cached-atom-shells')
|
||||
];
|
||||
|
||||
const rmPromises = [];
|
||||
for (let path of cachePaths) {
|
||||
console.log(`Cleaning ${path}`);
|
||||
fs.removeSync(path);
|
||||
rmPromises.push(fs.remove(path));
|
||||
}
|
||||
|
||||
return Promise.all(rmPromises);
|
||||
};
|
||||
|
@ -10,23 +10,25 @@ module.exports = function() {
|
||||
const fs = require('fs-extra');
|
||||
const glob = require('glob');
|
||||
|
||||
const rmPromises = [];
|
||||
|
||||
const apmDependenciesPath = path.join(CONFIG.apmRootPath, 'node_modules');
|
||||
console.log(`Cleaning ${apmDependenciesPath}`);
|
||||
fs.removeSync(apmDependenciesPath);
|
||||
rmPromises.push(fs.remove(apmDependenciesPath));
|
||||
|
||||
const atomDependenciesPath = path.join(
|
||||
CONFIG.repositoryRootPath,
|
||||
'node_modules'
|
||||
);
|
||||
console.log(`Cleaning ${atomDependenciesPath}`);
|
||||
fs.removeSync(atomDependenciesPath);
|
||||
rmPromises.push(fs.remove(atomDependenciesPath));
|
||||
|
||||
const scriptDependenciesPath = path.join(
|
||||
CONFIG.scriptRootPath,
|
||||
'node_modules'
|
||||
);
|
||||
console.log(`Cleaning ${scriptDependenciesPath}`);
|
||||
fs.removeSync(scriptDependenciesPath);
|
||||
rmPromises.push(fs.remove(scriptDependenciesPath));
|
||||
|
||||
const bundledPackageDependenciesPaths = path.join(
|
||||
CONFIG.repositoryRootPath,
|
||||
@ -37,6 +39,8 @@ module.exports = function() {
|
||||
for (const bundledPackageDependencyPath of glob.sync(
|
||||
bundledPackageDependenciesPaths
|
||||
)) {
|
||||
fs.removeSync(bundledPackageDependencyPath);
|
||||
rmPromises.push(fs.remove(bundledPackageDependencyPath));
|
||||
}
|
||||
|
||||
return Promise.all(rmPromises);
|
||||
};
|
||||
|
@ -4,6 +4,7 @@ const CONFIG = require('../config');
|
||||
module.exports = function() {
|
||||
if (fs.existsSync(CONFIG.buildOutputPath)) {
|
||||
console.log(`Cleaning ${CONFIG.buildOutputPath}`);
|
||||
fs.removeSync(CONFIG.buildOutputPath);
|
||||
return fs.remove(CONFIG.buildOutputPath);
|
||||
}
|
||||
return Promise.resolve();
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user