Support scripts/.env path

This commit is contained in:
Hamza-Ayed
2026-07-24 16:44:58 +03:00
parent b2261d9192
commit eacd71349e
4 changed files with 6 additions and 6 deletions
+2 -2
View File
@@ -8,7 +8,7 @@ const fs = require('fs');
const path = require('path');
// Auto-load .env file if present
const envPath = path.resolve(__dirname, '../.env');
const envPath = path.resolve(__dirname, '.env');
if (fs.existsSync(envPath)) {
const envContent = fs.readFileSync(envPath, 'utf8');
envContent.split('\n').forEach(line => {
@@ -85,7 +85,7 @@ async function generatePostWithGemini(topic = 'منشور تعريفي عن من
*/
async function publishToFacebook(message) {
console.log('Publishing generated post to Facebook Page...');
const url = `https://graph.facebook.com/v19.0/me/feed`;
let res = await fetch(url, {
method: 'POST',