Skip to content

Commit 4508ff5

Browse files
authored
Merge pull request #199 from atom-ide-community/parallel-copyassets
Parallel copy-assets
2 parents 5a7100b + 4baccf2 commit 4508ff5

File tree

2 files changed

+25
-15
lines changed

2 files changed

+25
-15
lines changed

script/build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ async function build() {
161161
if (!argv.existingBinaries) {
162162
checkChromedriverVersion()
163163
cleanOutputDirectory()
164-
copyAssets()
164+
await copyAssets()
165165
await transpile()
166166
generateModuleCache()
167167
prebuildLessCache()

script/lib/copy-assets.js

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,14 @@ module.exports = function() {
2525
ignore: path.join('**', '*-spec.*')
2626
})
2727
);
28+
29+
const copyPromises = [];
2830
for (let srcPath of srcPaths) {
29-
fs.copySync(srcPath, computeDestinationPath(srcPath), {
30-
filter: includePathInPackagedApp
31-
});
31+
copyPromises.push(
32+
fs.copy(srcPath, computeDestinationPath(srcPath), {
33+
filter: includePathInPackagedApp
34+
})
35+
);
3236
}
3337

3438
// Run a copy pass to dereference symlinked directories under node_modules.
@@ -50,20 +54,26 @@ module.exports = function() {
5054
'node_modules',
5155
path.basename(modulePath)
5256
);
53-
fs.copySync(modulePath, destPath, { filter: includePathInPackagedApp });
57+
copyPromises.push(
58+
fs.copy(modulePath, destPath, { filter: includePathInPackagedApp })
59+
);
5460
});
5561

56-
fs.copySync(
57-
path.join(
58-
CONFIG.repositoryRootPath,
59-
'resources',
60-
'app-icons',
61-
CONFIG.channel,
62-
'png',
63-
'1024.png'
64-
),
65-
path.join(CONFIG.intermediateAppPath, 'resources', 'atom.png')
62+
copyPromises.push(
63+
fs.copy(
64+
path.join(
65+
CONFIG.repositoryRootPath,
66+
'resources',
67+
'app-icons',
68+
CONFIG.channel,
69+
'png',
70+
'1024.png'
71+
),
72+
path.join(CONFIG.intermediateAppPath, 'resources', 'atom.png')
73+
)
6674
);
75+
76+
return Promise.all(copyPromises);
6777
};
6878

6979
function computeDestinationPath(srcPath) {

0 commit comments

Comments
 (0)