Skip to content

Commit 1dc5a4f

Browse files
authored
fix: auto-wrap variables.json content in Variables object
- CLI automatically wraps raw variables in {Variables: ...} structure
1 parent 5f8e230 commit 1dc5a4f

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

messages/orchestrator.rules.eval.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Path to Analytics variables.json file.
3636

3737
# flags.variables.description
3838

39-
Path to the variables.json file containing variable definitions used in transformations.
39+
Path to the variables.json file containing variable definitions used in transformations. The file should contain a flat JSON object with key-value pairs. The CLI will automatically wrap these in the required Variables structure.
4040

4141
# flags.rules.summary
4242

src/commands/orchestrator/rules/eval.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,9 @@ export default class TemplateEval extends SfCommand<TemplatePreviewResult> {
183183
// Read variables file
184184
this.log(`Loading variables: ${variablesFile}`);
185185
const variablesContent = await fs.readFile(variablesFile, 'utf8');
186-
const values = JSON.parse(variablesContent) as { Variables: Record<string, unknown> };
186+
const variablesData = JSON.parse(variablesContent) as Record<string, unknown>;
187+
188+
const values = { Variables: variablesData };
187189

188190
// Read rules file
189191
this.log(`Loading rules: ${rulesFile}`);

0 commit comments

Comments
 (0)