netcore-blueprint 0.0.95 → 0.0.97

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.
@@ -11,6 +11,7 @@ const { addProjectReferencesToCsproj, copyRecursive } = require('../lib/replacer
11
11
 
12
12
  const sourceModuleName = "AiAssistantModule";
13
13
  const assistantName = "__ASSISTANT_NAME__";
14
+ const force = process.argv.includes('--force');
14
15
 
15
16
  // =======================
16
17
  // FIND SOLUTION ROOT
@@ -58,8 +59,14 @@ if (!fs.existsSync(templateRoot)) {
58
59
  }
59
60
 
60
61
  if (fs.existsSync(targetModuleRoot)) {
61
- console.error(`❌ Module already exists: ${targetModuleRoot}`);
62
- process.exit(1);
62
+ if (!force) {
63
+ console.error(`❌ Target module already exists: ${targetModuleRoot}`);
64
+ console.error(` Use --force to overwrite.`);
65
+ process.exit(1);
66
+ }
67
+
68
+ console.log(`🔥 --force detected. Removing existing module: ${targetModuleRoot}`);
69
+ fs.rmSync(targetModuleRoot, { recursive: true, force: true });
63
70
  }
64
71
 
65
72
  console.log(`📦 Creating assistant module`);
@@ -136,7 +143,7 @@ if (fs.existsSync(defaultFile)) {
136
143
  const assistantTemplate = path.join(
137
144
  templateRoot,
138
145
  "Assistants",
139
- "__ASSISTANT_NAME__"
146
+ assistantName
140
147
  );
141
148
 
142
149
  if (fs.existsSync(assistantTemplate)) {
@@ -177,7 +184,8 @@ execSync(`dotnet build "${solutionFile}"`, { stdio: 'inherit' });
177
184
  addProjectReferencesToCsproj(hostApiProjectPath, [
178
185
  `..\\..\\Modules\\${sourceModuleName}\\Engine\\${sourceModuleName}.API\\${sourceModuleName}.API.csproj`,
179
186
  `..\\..\\Modules\\${sourceModuleName}\\Engine\\${sourceModuleName}.Core\\${sourceModuleName}.Core.csproj`,
180
- `..\\..\\Modules\\${sourceModuleName}\\Engine\\${sourceModuleName}.Infrastructure\\${sourceModuleName}.Infrastructure.csproj`
187
+ `..\\..\\Modules\\${sourceModuleName}\\Engine\\${sourceModuleName}.Infrastructure\\${sourceModuleName}.Infrastructure.csproj`,
188
+ `..\\..\\Modules\\${sourceModuleName}\\Assistants\\${assistantName}\\${assistantName}.csproj`
181
189
  ]);
182
190
 
183
191
  console.log(`🎉 DONE`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "netcore-blueprint",
3
- "version": "0.0.95",
3
+ "version": "0.0.97",
4
4
  "description": "A custom project blueprint",
5
5
  "main": "create.js",
6
6
  "bin": {