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] Variable inside a single apix string #182

Open
Mte90 opened this issue Jun 12, 2024 · 4 comments
Open

[Bug] Variable inside a single apix string #182

Mte90 opened this issue Jun 12, 2024 · 4 comments
Labels
bug Something isn't working compiler

Comments

@Mte90
Copy link
Member

Mte90 commented Jun 12, 2024

Taking this example:

position = 1
$jq -r '.[0].assets.[{position}].browser_download_url'$

Generate this bash script:

jq -r '.[0].assets.[{position}].browser_download_url'

But inside a single apix string the variable doesn't get substituted, so Amber should report an error or compile it with double apix.

@Mte90
Copy link
Member Author

Mte90 commented Jun 12, 2024

Looking at the issues with Shellcheck we have issues with variables that aren't wrapped with " are reported.
So I think that can be handy to:

  • Remap all the strings with a single apix to a double one if there is a variable inside
  • All the variables printed should be double apix wrapped

@Ph0enixKM
Copy link
Member

Ph0enixKM commented Jun 13, 2024

It seems a bit wrong since this would modify bash commands under the hood. The Bash that is written by user should verbatim be the same. Instead - this could be solved with the ORM you mentioned in another issue.

@Mte90
Copy link
Member Author

Mte90 commented Jun 13, 2024

It is something that is language design, like the user can do whatever you want but if you use the std exposed by Amber automatically write Bash that is valid for shellcheck.

@Ph0enixKM
Copy link
Member

Ph0enixKM commented Jun 19, 2024

@Mte90 I've read this issue one more time and I take back what I said previously. This is a good issue. We should make the variables to be interpolated correctly even if they are in the verbatim string.

@Ph0enixKM Ph0enixKM changed the title [Bug] Variable inside a single apix string 🐞 Variable inside a single apix string Jun 19, 2024
@Mte90 Mte90 added the bug Something isn't working label Jun 24, 2024
@Mte90 Mte90 added the compiler label Jul 19, 2024
@Ph0enixKM Ph0enixKM changed the title 🐞 Variable inside a single apix string [Bgu] Variable inside a single apix string Sep 16, 2024
@Ph0enixKM Ph0enixKM changed the title [Bgu] Variable inside a single apix string [Bug] Variable inside a single apix string Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working compiler
Projects
None yet
Development

No branches or pull requests

2 participants