@hubspot/local-dev-lib 3.14.0-beta.0 → 3.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/archive.js +3 -0
- package/package.json +1 -1
package/lib/archive.js
CHANGED
|
@@ -109,6 +109,7 @@ async function copySourceToDest(src, dest, { sourceDir, includesRootDir = true,
|
|
|
109
109
|
for (let i = 0; i < sourceDirs.length; i++) {
|
|
110
110
|
const projectSrcDir = (0, path_1.join)(...srcDirPath, sourceDirs[i]);
|
|
111
111
|
let collisions = [];
|
|
112
|
+
let filesWithoutCollisions = [];
|
|
112
113
|
if (fs_extra_1.default.existsSync(dest) &&
|
|
113
114
|
handleCollision &&
|
|
114
115
|
typeof handleCollision === 'function') {
|
|
@@ -116,6 +117,7 @@ async function copySourceToDest(src, dest, { sourceDir, includesRootDir = true,
|
|
|
116
117
|
const newFiles = (await (0, fs_1.walk)(projectSrcDir, ['node_modules'])).map(file => path_1.default.relative(projectSrcDir, file));
|
|
117
118
|
// Find files that exist in the same positions in both directories
|
|
118
119
|
collisions = existingFiles.filter(currentFile => newFiles.includes(currentFile));
|
|
120
|
+
filesWithoutCollisions = newFiles.filter(currentFile => !collisions.includes(currentFile));
|
|
119
121
|
}
|
|
120
122
|
if (collisions.length &&
|
|
121
123
|
handleCollision &&
|
|
@@ -125,6 +127,7 @@ async function copySourceToDest(src, dest, { sourceDir, includesRootDir = true,
|
|
|
125
127
|
src: projectSrcDir,
|
|
126
128
|
collisions,
|
|
127
129
|
});
|
|
130
|
+
await Promise.all(filesWithoutCollisions.map(currentFile => fs_extra_1.default.copy(path_1.default.join(projectSrcDir, currentFile), path_1.default.join(dest, currentFile))));
|
|
128
131
|
}
|
|
129
132
|
else {
|
|
130
133
|
await fs_extra_1.default.copy(projectSrcDir, dest);
|
package/package.json
CHANGED