Skip to content

Cannot expand variable in other variable on the top of line #52

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

Open
mitsuru793 opened this issue Mar 3, 2021 · 2 comments
Open

Cannot expand variable in other variable on the top of line #52

mitsuru793 opened this issue Mar 3, 2021 · 2 comments

Comments

@mitsuru793
Copy link

mitsuru793 commented Mar 3, 2021

Thank you very much for this project!
I found a bug.

This yaml file not works.

error loading configuration: yaml: line 10: did not find expected key

I got the above error.

run:
  exec: echo {{.script}}

variables:
  root: $(echo $HOME/myproject/)
  script:  {{.root}}/index.php

However this is works.

run:
  exec: echo {{.script}}

variables:
  root: $(echo $HOME/myproject/)
  script:  index.php/{{.root}}  # swap

I'm restricted where expanding variable only after string.

@jenpet
Copy link
Contributor

jenpet commented Jun 21, 2022

Hey there, you're right. When you use it with quotes, it works:

variables:
  root: $(echo $HOME/myproject/)
  script:  "{{.root}}/index.php"

A little fix could be introduced in order to avoid the workarounds.

@tadeboro
Copy link

tadeboro commented Jan 8, 2023

A little fix could be introduced in order to avoid the workarounds.

The main issue here is that the original file is not valid YAML file. The only way to fix this is to stop using YAML as a configuration format and use something custom.

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

No branches or pull requests

3 participants