mirror of
https://github.com/alexgo-io/DefiLlama-Adapters.git
synced 2026-05-01 22:24:57 +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 inquirer = require('inquirer')
|
||||||
const childProcess = require('child_process')
|
const childProcess = require('child_process')
|
||||||
inquirer.registerPrompt('fuzzypath', require('inquirer-fuzzy-path'))
|
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());
|
console.log('Starting directory: ' + process.cwd());
|
||||||
const args = process.argv.slice(2); // The first two elements are 'node' and the script filename
|
const args = process.argv.slice(2); // The first two elements are 'node' and the script filename
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user