Skip to content

Commit 0ff8544

Browse files
authored
Fix .env creating an invalid array of endpoints (#2997)
* Fix .env creating an invalid array of endpoints * Update changelog
1 parent ee05998 commit 0ff8544

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

packages/cli/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

77
## [Unreleased]
8+
### Fixed
9+
- Issue initializing .env file endpoints array (#2997)
810

911
## [6.6.2] - 2025-12-16
1012
### Fixed

packages/cli/src/controller/init-controller.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,9 @@ export async function prepareEnv(projectPath: string, project: ProjectSpecBase):
319319
}
320320

321321
//adding env configs
322-
const envData = `ENDPOINT=${JSON.stringify(project.endpoint)}\nCHAIN_ID=${chainId}`;
322+
const endpointStr = Array.isArray(project.endpoint) ? project.endpoint.join(',') : JSON.stringify(project.endpoint);
323+
324+
const envData = `ENDPOINT=${endpointStr}\nCHAIN_ID=${chainId}`;
323325
await fs.promises.writeFile(envPath, envData, 'utf8');
324326
await fs.promises.writeFile(envDevelopPath, envData, 'utf8');
325327
await fs.promises.writeFile(envLocalPath, envData, 'utf8');

0 commit comments

Comments
 (0)