mcp-google-drive
Version:
Advanced MCP server for Google Drive integration with full CRUD operations, file management, and sharing capabilities. Supports both OAuth2 and Service Account authentication.
32 lines • 1.28 kB
JavaScript
import * as fs from 'fs';
/**
* Load environment variables from .env files
*/
export function loadEnvFile() {
const envFiles = ['.env', '.env.local', '.env.development', '.env.production'];
const envVars = {};
for (const envFile of envFiles) {
try {
if (fs.existsSync(envFile)) {
const content = fs.readFileSync(envFile, 'utf-8');
const lines = content.split('\n');
for (const line of lines) {
const trimmedLine = line.trim();
if (trimmedLine && !trimmedLine.startsWith('#')) {
const [key, ...valueParts] = trimmedLine.split('=');
if (key && valueParts.length > 0) {
const value = valueParts.join('=').replace(/^["']|["']$/g, '');
envVars[key] = value;
process.env[key] = value;
}
}
}
console.error(`[${new Date().toISOString()}] [DEBUG] MCP-Google-Drive: Loaded environment variables from ${envFile}`);
}
}
catch (error) {
// Silently ignore file read errors
}
}
}
//# sourceMappingURL=envLoader.js.map