mirror of
https://github.com/alexgo-io/DefiLlama-Adapters.git
synced 2026-01-12 16:53:02 +08:00
fix: load environment variables before changing directories in testInteractive.js
- Add dotenv configuration with absolute path before changing working directory - Ensures environment variables are loaded consistently regardless of working directory - Fixes issue where SOLANA_RPC and other env vars were not available during adapter testing
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
const inquirer = require('inquirer')
|
||||
const childProcess = require('child_process')
|
||||
inquirer.registerPrompt('fuzzypath', require('inquirer-fuzzy-path'))
|
||||
|
||||
// Load environment variables before changing directories
|
||||
require('dotenv').config({ path: require('path').resolve(__dirname, '../../.env') })
|
||||
|
||||
console.log('Starting directory: ' + process.cwd());
|
||||
const args = process.argv.slice(2); // The first two elements are 'node' and the script filename
|
||||
|
||||
|
||||
Reference in New Issue
Block a user