netcore-blueprint 0.0.34 → 0.0.36

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.
Files changed (2) hide show
  1. package/bin/copy-module.js +10 -3
  2. package/package.json +1 -1
@@ -11,6 +11,7 @@ const { execSync } = require('child_process');
11
11
  // =====================================================
12
12
 
13
13
  const sourceModuleName = process.argv[2];
14
+ const force = process.argv.includes('--force');
14
15
 
15
16
  if (!sourceModuleName) {
16
17
  console.error("❌ Usage: copy-module <SourceModuleName>");
@@ -22,7 +23,7 @@ if (!sourceModuleName) {
22
23
  const modulesPath = process.cwd();
23
24
 
24
25
  const templateRoot = path.join(modulesPath, sourceModuleName);
25
- const targetModuleRoot = path.join(modulesPath, '..', 'BlueprintTemplate', 'Modules', `${sourceModuleName}Module`);
26
+ const targetModuleRoot = path.join(modulesPath, '..', 'BlueprintTemplate', `${sourceModuleName}Module`);
26
27
 
27
28
  const solutionFile = findSolutionFileFixed(modulesPath);
28
29
 
@@ -32,8 +33,14 @@ if (!fs.existsSync(templateRoot)) {
32
33
  }
33
34
 
34
35
  if (fs.existsSync(targetModuleRoot)) {
35
- console.error(`❌ Target module already exists: ${targetModuleRoot}`);
36
- process.exit(1);
36
+ if (!force) {
37
+ console.error(`❌ Target module already exists: ${targetModuleRoot}`);
38
+ console.error(` Use --force to overwrite.`);
39
+ process.exit(1);
40
+ }
41
+
42
+ console.log(`🔥 --force detected. Removing existing module: ${targetModuleRoot}`);
43
+ fs.rmSync(targetModuleRoot, { recursive: true, force: true });
37
44
  }
38
45
 
39
46
  if (!solutionFile) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "netcore-blueprint",
3
- "version": "0.0.34",
3
+ "version": "0.0.36",
4
4
  "description": "A custom project blueprint",
5
5
  "main": "create.js",
6
6
  "bin": {