netcore-blueprint 1.0.13 → 1.0.14
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/create.js +6 -12
- package/package.json +1 -1
package/create.js
CHANGED
|
@@ -20,23 +20,17 @@ const templateItems = [
|
|
|
20
20
|
"gitignore" // Rename later
|
|
21
21
|
];
|
|
22
22
|
|
|
23
|
-
function
|
|
23
|
+
function copyFilesRecursively(src, dest) {
|
|
24
24
|
if (fs.lstatSync(src).isDirectory()) {
|
|
25
25
|
fs.mkdirSync(dest, { recursive: true });
|
|
26
26
|
const entries = fs.readdirSync(src, { withFileTypes: true });
|
|
27
27
|
for (let entry of entries) {
|
|
28
28
|
const srcPath = path.join(src, entry.name);
|
|
29
29
|
const destPath = path.join(dest, entry.name);
|
|
30
|
-
|
|
30
|
+
copyFilesRecursively(srcPath, destPath);
|
|
31
31
|
}
|
|
32
32
|
} else {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
// Rename Solution and Project Names
|
|
36
|
-
content = content.replace(/Blueprint\.API/g, projectName.toUpperCase());
|
|
37
|
-
content = content.replace(/Blueprint/g, projectName.toUpperCase());
|
|
38
|
-
|
|
39
|
-
fs.writeFileSync(dest, content);
|
|
33
|
+
fs.copyFileSync(src, dest);
|
|
40
34
|
}
|
|
41
35
|
}
|
|
42
36
|
|
|
@@ -48,7 +42,7 @@ if (fs.existsSync(destinationPath)) {
|
|
|
48
42
|
|
|
49
43
|
fs.mkdirSync(destinationPath, { recursive: true });
|
|
50
44
|
|
|
51
|
-
// Copy template files
|
|
45
|
+
// Copy template files without renaming
|
|
52
46
|
templateItems.forEach(item => {
|
|
53
47
|
const srcPath = path.join(__dirname, item);
|
|
54
48
|
let destPath = path.join(destinationPath, item);
|
|
@@ -59,11 +53,11 @@ templateItems.forEach(item => {
|
|
|
59
53
|
|
|
60
54
|
if (fs.existsSync(srcPath)) {
|
|
61
55
|
console.log(`✅ Copying ${item}...`);
|
|
62
|
-
|
|
56
|
+
copyFilesRecursively(srcPath, destPath);
|
|
63
57
|
} else {
|
|
64
58
|
console.error(`❌ Critical error: "${srcPath}" does not exist.`);
|
|
65
59
|
process.exit(1);
|
|
66
60
|
}
|
|
67
61
|
});
|
|
68
62
|
|
|
69
|
-
console.log(`🎉 Project "${projectName}" created successfully at ${destinationPath}`);
|
|
63
|
+
console.log(`🎉 Project "${projectName}" created successfully at ${destinationPath}`);
|