bmad-odoo 1.0.4 → 1.0.5
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/package.json +1 -1
- package/scripts/postinstall.js +24 -8
package/package.json
CHANGED
package/scripts/postinstall.js
CHANGED
|
@@ -421,27 +421,43 @@ function printSuccessMessage(selectedIde) {
|
|
|
421
421
|
|
|
422
422
|
// Main function
|
|
423
423
|
async function main() {
|
|
424
|
+
console.log('\n🚀 BMAD-Odoo postinstall script starting...\n');
|
|
425
|
+
|
|
424
426
|
const projectRoot = getProjectRoot();
|
|
425
427
|
const packageRoot = path.join(__dirname, '..');
|
|
426
428
|
|
|
429
|
+
console.log(`📂 Package root: ${packageRoot}`);
|
|
430
|
+
console.log(`📂 Project root: ${projectRoot || 'NOT FOUND'}\n`);
|
|
431
|
+
|
|
427
432
|
if (!projectRoot) {
|
|
428
433
|
logWarning('Không tìm thấy project root. Bỏ qua auto-setup.');
|
|
429
|
-
logWarning('Bạn có thể setup thủ công
|
|
430
|
-
|
|
434
|
+
logWarning('Bạn có thể setup thủ công bằng lệnh: npx bmad-odoo-setup\n');
|
|
435
|
+
process.exit(0);
|
|
431
436
|
}
|
|
432
437
|
|
|
433
438
|
// Check if running interactively (has stdin)
|
|
434
439
|
const isInteractive = process.stdin.isTTY;
|
|
435
440
|
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
441
|
+
console.log(`🔧 Interactive mode: ${isInteractive ? 'YES' : 'NO (using auto-setup)'}\n`);
|
|
442
|
+
|
|
443
|
+
try {
|
|
444
|
+
if (isInteractive) {
|
|
445
|
+
await interactiveSetup(projectRoot, packageRoot);
|
|
446
|
+
} else {
|
|
447
|
+
autoSetup(projectRoot, packageRoot);
|
|
448
|
+
}
|
|
449
|
+
} catch (error) {
|
|
450
|
+
logError(`Lỗi trong quá trình setup: ${error.message}`);
|
|
451
|
+
console.error(error.stack);
|
|
452
|
+
logWarning('Bạn có thể setup thủ công bằng lệnh: npx bmad-odoo-setup\n');
|
|
453
|
+
process.exit(0); // Don't fail npm install
|
|
440
454
|
}
|
|
441
455
|
}
|
|
442
456
|
|
|
443
457
|
// Run the script
|
|
444
458
|
main().catch((error) => {
|
|
445
|
-
logError(`Lỗi
|
|
446
|
-
|
|
459
|
+
logError(`Lỗi fatal: ${error.message}`);
|
|
460
|
+
console.error(error.stack);
|
|
461
|
+
logWarning('Bạn có thể setup thủ công bằng lệnh: npx bmad-odoo-setup\n');
|
|
462
|
+
process.exit(0); // Don't fail npm install
|
|
447
463
|
});
|