Skip to content

Commit

Permalink
Fix environment variable handling by preserving placeholders for miss…
Browse files Browse the repository at this point in the history
…ing values
  • Loading branch information
Inkvi committed Nov 4, 2024
1 parent 7927887 commit 03cdfe5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/ibc-processor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export function IbcProcessor(processorName?: string) {
try {
const fileContents = fs.readFileSync(configPath, 'utf8')
const interpolatedFileContents = fileContents.replace(/\$\{([A-Z0-9_]+)}/g, (match, p1) => {
return process.env[p1] || match; // Replace with env var value, or keep the placeholder if not found
return process.env[p1] !== undefined ? String(process.env[p1]) : match; // Replace with env var value (even if empty), or keep the placeholder if not found
});
const interpolatedConfig = yaml.load(interpolatedFileContents) as Record<string, any>
config = ConfigSchema.parse(interpolatedConfig)
Expand Down

0 comments on commit 03cdfe5

Please sign in to comment.