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

does not substitute arguments #2551

Closed
IvanKirpichnikov opened this issue Dec 27, 2024 · 2 comments
Closed

does not substitute arguments #2551

IvanKirpichnikov opened this issue Dec 27, 2024 · 2 comments

Comments

@IvanKirpichnikov
Copy link

justfile:

command arg = "default":
    {{ if arg == "default" { "echo 'default arg {{ arg }}'" } else { "echo 'not default arg {{ arg }}'" } }}

enter in console: just command

expected output:

echo 'default arg default'
default arg default

real output:

echo 'default arg {{ arg }}'
default arg {{ arg }}
@casey
Copy link
Owner

casey commented Dec 27, 2024

just doesn't perform {{…}} interpolation inside strings. You can use +:

command arg = "default":
{{ if arg == "default" { "echo 'default arg " + arg + "'" } else { "echo 'not default arg " + arg + "'" } }}

See #11 for the issue. Don't look at how old it is T_T

@casey casey closed this as completed Dec 27, 2024
@IvanKirpichnikov
Copy link
Author

personally, it seemed to me that formatting strings should get rid of this kind of code. Well okay. Thanks for the help

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

2 participants