Variable Scoping not honored on imports
Tyler-Hartwig-Pariveda opened this issue · comments
Tyler-Hartwig-Pariveda commented
Hi, I ran into an issue with importing diagrams and variable scoping:
template.d2
env: {
label: ${env} Environment
vm: {
label: My Virtual machine!
}
}
environments.d2
dev: {
vars: {
env: Dev
}
...@template.d2
}
qa: {
vars: {
env: Qa
}
...@template.d2
}
I'd expect this to render with "Qa" and "Dev" in each respective environment, instead "Dev" is used on both diagrams!
Alexander Wang commented
@Tyler-Hartwig-Pariveda is this the full script? Do you mean to import template.d2
in the qa
scope too?
Tyler-Hartwig-Pariveda commented
@Tyler-Hartwig-Pariveda is this the full script? Do you mean to import
template.d2
in theqa
scope too?
That's correct, sorry, i missed that, I'll go update the original post!
Alexander Wang commented
ty for reporting this