-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheck-setup.mjs
More file actions
53 lines (39 loc) · 2.04 KB
/
check-setup.mjs
File metadata and controls
53 lines (39 loc) · 2.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/usr/bin/env node
console.log('🔍 检查Simple Outlook MCP设置状态...\n');
import fs from 'fs';
import path from 'path';
import { fileURLToPath } from 'url';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
// 检查构建文件
const buildPath = path.join(__dirname, '../build/index-simple.js');
const buildExists = fs.existsSync(buildPath);
console.log(`📦 构建状态: ${buildExists ? '✅ 已完成' : '❌ 需要运行 npm run build'}`);
// 检查依赖
const nodeModulesPath = path.join(__dirname, '../node_modules');
const nodeModulesExists = fs.existsSync(nodeModulesPath);
console.log(`📚 依赖安装: ${nodeModulesExists ? '✅ 已完成' : '❌ 需要运行 npm install'}`);
// 检查环境变量文件
const envPath = path.join(__dirname, '../.env');
const envExists = fs.existsSync(envPath);
console.log(`⚙️ 环境配置: ${envExists ? '✅ 已配置' : '❌ 需要复制 .env-simple.example 到 .env'}`);
if (envExists) {
const envContent = fs.readFileSync(envPath, 'utf8');
const hasEmail = envContent.includes('OUTLOOK_EMAIL=') && !envContent.includes('your_email@outlook.com');
const hasPassword = envContent.includes('OUTLOOK_APP_PASSWORD=') && !envContent.includes('your_app_specific_password_here');
console.log(`📧 邮箱配置: ${hasEmail ? '✅ 已设置' : '❌ 需要配置真实邮箱地址'}`);
console.log(`🔑 应用密码: ${hasPassword ? '✅ 已设置' : '❌ 需要配置应用密码'}`);
}
console.log('\n🎯 下一步操作:');
if (!nodeModulesExists) {
console.log('1. 运行: npm install');
} else if (!buildExists) {
console.log('1. 运行: npm run build');
} else if (!envExists) {
console.log('1. 复制配置文件: cp .env-simple.example .env');
console.log('2. 编辑 .env 文件,填入你的邮箱和应用密码');
} else {
console.log('🚀 准备就绪!运行: npm start');
console.log('\n💡 应用密码获取地址: https://account.microsoft.com/security');
}
console.log('\n📖 详细说明请查看: README-SIMPLE.md');