Skip to content

Commit

Permalink
feat: add global args
Browse files Browse the repository at this point in the history
  • Loading branch information
guoxianzhe committed Dec 6, 2024
1 parent f08e270 commit 3b02819
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ renderers:
args:
config1: true
config2: 'xyz'

# List of global args
globalArgs:
type: 'rtc'
```
### Custom `Parser` and `Renderer`
Expand Down
7 changes: 7 additions & 0 deletions terra/src/base/terra_configs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@ export class TerraConfigs {
});

let renderers = (parsedYaml.renderers ?? []).map((p: any) => {
p.args =
parsedYaml.globalArgs || p.args
? {
...parsedYaml.globalArgs,
...p.args,
}
: undefined;
return p as TerraLoaderConfig;
});

Expand Down

0 comments on commit 3b02819

Please sign in to comment.