Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Tera should only evaluate templates after all where clauses have been analysed #283

Open
airtonix opened this issue Dec 3, 2022 · 1 comment
Assignees

Comments

@airtonix
Copy link
Contributor

airtonix commented Dec 3, 2022

Description

When I try to evaluate this manifest on linux or macos it fails because it can't find the envvar:

---
where: os.name == "windows"

actions:

  - action: file.copy
    from: winget.json
    to: '{{get_env(name="LOCALAPPDATA", "")}}\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json'

on windows LOCALAPPDATA is effectively ~/AppData/Local.

I'm working around this by doing this instead which doesn't cause an error:

---
where: os.name == "windows"

actions:

  - action: file.copy
    from: winget.json
    to: '{{user.home_dir}}\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json'

Steps to reproduce

comtrya -d https://github.com/airtonix/ComtryaProblemRepo#master:tera-evaluates-all-templates-before-where-plan apply

Expected behaviour
What the expected behaviour in your opinion.

Environment

  • OS: windows 11
  • Version: 0.8.0

Additional information
Add more context which didn't fit in the fields above.

@icepuma icepuma self-assigned this Dec 8, 2022
@rawkode
Copy link
Member

rawkode commented Dec 10, 2022

Good catch. We’ll get this fixed up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants