()
| 86 | |
| 87 | // 验证安装 |
| 88 | function verifyInstallation() { |
| 89 | try { |
| 90 | const packagePath = getPackagePath(); |
| 91 | const serverPath = path.join(packagePath, 'server.js'); |
| 92 | const dbPath = path.join(packagePath, 'data', 'icss.db'); |
| 93 | |
| 94 | console.log('\n🔍 Verifying installation...'); |
| 95 | |
| 96 | if (!fs.existsSync(serverPath)) { |
| 97 | throw new Error(`Server file not found: ${serverPath}`); |
| 98 | } |
| 99 | console.log('✅ Server file exists'); |
| 100 | |
| 101 | if (!fs.existsSync(dbPath)) { |
| 102 | console.log('⚠️ Database not found, will be created on first run'); |
| 103 | } else { |
| 104 | console.log('✅ Database file exists'); |
| 105 | } |
| 106 | |
| 107 | // 检查新增的脚本文件 |
| 108 | const inspirationScript = path.join(packagePath, 'scripts', 'fetch-inspiration.js'); |
| 109 | if (fs.existsSync(inspirationScript)) { |
| 110 | console.log('✅ CSS-Inspiration integration script exists'); |
| 111 | } |
| 112 | |
| 113 | const testInspiration = path.join(packagePath, 'test-inspiration.js'); |
| 114 | if (fs.existsSync(testInspiration)) { |
| 115 | console.log('✅ CSS-Inspiration test script exists'); |
| 116 | } |
| 117 | |
| 118 | console.log('✅ Installation verified'); |
| 119 | |
| 120 | } catch (error) { |
| 121 | console.error('❌ Installation verification failed:', error.message); |
| 122 | throw error; |
| 123 | } |
| 124 | } |
| 125 | |
| 126 | // 显示使用说明 |
| 127 | function showUsageInstructions(configFile) { |
no test coverage detected