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.
- package/bin/create-assistant.js +12 -4
- package/package.json +1 -1
package/bin/create-assistant.js
CHANGED
|
@@ -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
|
-
|
|
62
|
-
|
|
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
|
-
|
|
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`);
|