Support scripts/.env path
This commit is contained in:
@@ -8,7 +8,7 @@ const fs = require('fs');
|
|||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
|
||||||
// Auto-load .env file if present
|
// Auto-load .env file if present
|
||||||
const envPath = path.resolve(__dirname, '../.env');
|
const envPath = path.resolve(__dirname, '.env');
|
||||||
if (fs.existsSync(envPath)) {
|
if (fs.existsSync(envPath)) {
|
||||||
const envContent = fs.readFileSync(envPath, 'utf8');
|
const envContent = fs.readFileSync(envPath, 'utf8');
|
||||||
envContent.split('\n').forEach(line => {
|
envContent.split('\n').forEach(line => {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ const fs = require('fs');
|
|||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
|
||||||
// Auto-load .env file if present
|
// Auto-load .env file if present
|
||||||
const envPath = path.resolve(__dirname, '../.env');
|
const envPath = path.resolve(__dirname, '.env');
|
||||||
if (fs.existsSync(envPath)) {
|
if (fs.existsSync(envPath)) {
|
||||||
const envContent = fs.readFileSync(envPath, 'utf8');
|
const envContent = fs.readFileSync(envPath, 'utf8');
|
||||||
envContent.split('\n').forEach(line => {
|
envContent.split('\n').forEach(line => {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ const fs = require('fs');
|
|||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
|
||||||
// Auto-load .env file if present
|
// Auto-load .env file if present
|
||||||
const envPath = path.resolve(__dirname, '../.env');
|
const envPath = path.resolve(__dirname, '.env');
|
||||||
if (fs.existsSync(envPath)) {
|
if (fs.existsSync(envPath)) {
|
||||||
const envContent = fs.readFileSync(envPath, 'utf8');
|
const envContent = fs.readFileSync(envPath, 'utf8');
|
||||||
envContent.split('\n').forEach(line => {
|
envContent.split('\n').forEach(line => {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ const fs = require('fs');
|
|||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
|
||||||
// Auto-load .env file if present
|
// Auto-load .env file if present
|
||||||
const envPath = path.resolve(__dirname, '../.env');
|
const envPath = path.resolve(__dirname, '.env');
|
||||||
if (fs.existsSync(envPath)) {
|
if (fs.existsSync(envPath)) {
|
||||||
const envContent = fs.readFileSync(envPath, 'utf8');
|
const envContent = fs.readFileSync(envPath, 'utf8');
|
||||||
envContent.split('\n').forEach(line => {
|
envContent.split('\n').forEach(line => {
|
||||||
|
|||||||
Reference in New Issue
Block a user