@adriansteffan/reactive 0.1.30 → 0.1.31
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/bin/setup.js +9 -9
- package/package.json +1 -1
package/bin/setup.js
CHANGED
|
@@ -21,7 +21,7 @@ const rl = readline.createInterface({
|
|
|
21
21
|
const question = (query) => new Promise((resolve) => rl.question(query, resolve));
|
|
22
22
|
|
|
23
23
|
|
|
24
|
-
function copyDir(src, dest,
|
|
24
|
+
function copyDir(src, dest, ignoreEntries = []) {
|
|
25
25
|
mkdirSync(dest, { recursive: true });
|
|
26
26
|
|
|
27
27
|
const entries = readdirSync(src, { withFileTypes: true });
|
|
@@ -29,17 +29,17 @@ function copyDir(src, dest, ignoreFiles = []) {
|
|
|
29
29
|
for (let entry of entries) {
|
|
30
30
|
const srcPath = join(src, entry.name);
|
|
31
31
|
const destPath = join(dest, entry.name);
|
|
32
|
-
|
|
33
|
-
// Check if the current
|
|
34
|
-
const shouldIgnore =
|
|
32
|
+
|
|
33
|
+
// Check if the current entry matches any in the ignore list
|
|
34
|
+
const shouldIgnore = ignoreEntries.some(ignorePath =>
|
|
35
35
|
join(src, entry.name) === join(src, ignorePath)
|
|
36
36
|
);
|
|
37
|
+
if (shouldIgnore) continue;
|
|
37
38
|
|
|
38
|
-
if (entry.
|
|
39
|
-
// only ignore at top level
|
|
40
|
-
copyDir(srcPath, destPath);
|
|
41
|
-
} else if (shouldIgnore) {
|
|
39
|
+
if (entry.isSymbolicLink()) {
|
|
42
40
|
continue;
|
|
41
|
+
} else if (entry.isDirectory()) {
|
|
42
|
+
copyDir(srcPath, destPath);
|
|
43
43
|
} else {
|
|
44
44
|
copyFileSync(srcPath, destPath);
|
|
45
45
|
}
|
|
@@ -66,7 +66,7 @@ async function main() {
|
|
|
66
66
|
process.exit(1);
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
copyDir(templatePath, projectPath, ['package.json','capacitor.config.js']);
|
|
69
|
+
copyDir(templatePath, projectPath, ['package.json','capacitor.config.js','node_modules']);
|
|
70
70
|
|
|
71
71
|
const templatePackageJsonPath = join(templatePath, 'package.json');
|
|
72
72
|
if (!existsSync(templatePackageJsonPath)) {
|