-
Notifications
You must be signed in to change notification settings - Fork 502
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
How to use variables in commands with backticks? #1292
Comments
My guess is that all or multiple lines like that are processed concurrently or at least not in order. Though @casey would know for sure. 😇 |
So a few things are preventing this from working. First,
However, assignments are not processed in the order that they appear in a source file, so exported variables aren't available in backticks within the same scope, so Hopefully we'll eventually support some kind of syntax that allows this, perhaps #799 or #822, but it might be a while! Sorry I don't have better news! |
Ah okay that's clear, thanks. I'm sure I'll find another solution for my problem :) |
Sorry to bump an old issue but just to be sure, this is not possible to escape variables directly either right? root := `{{justfile_directory() / ".."}} | path expand` (I use nushell here but you can replace the idea with EDIT: actually in my case the execution pwd in in fact justfile_directory.. so unrelated but this works fine: |
That's correct, interpolations in backticks aren't supported. |
to bad... still true in 2024 ? |
I read the README and couldn't find this. If I missed it, apologies.
In Makefile, I could do this:
In
just
, I understand that backticks can be used to save the output of a command:however, the second command fails with
/usr/bin/sh: GIT_COMMIT: command not found
The {{}} syntax also doesn't work here, how can I use a variable in a command?
The text was updated successfully, but these errors were encountered: