Replies: 2 comments 3 replies
-
First, where are the closing curly braces in
I believe it should be
Second, what shell are you using, CMD, |
Beta Was this translation helpful? Give feedback.
1 reply
-
Yeah, it can take a minute to get used to it all. Maybe this example will help. Try the following code: invokdir := invocation_directory()
printdir:
#!/bin/sh
echo ' raw: {{invocation_directory()}} (just in sh)'
invokdir='{{invocation_directory()}} (just to sh var)'
myvar=`cd ${invokdir} && pwd`
echo "invokdir: {{invokdir}} (just Justfile body)"
echo "invokdir: ${invokdir}"
echo " myvar: ${myvar} (pure sh)" In this context the |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I want to set a variable like:
the rub is that I want it to run in
invocation_directory()
rather than the justfile directory.I tried
I also tried
[no-cd]
on the command itself, thinking maybe it would apply that when evaluating the variable. It doesn't, and I can see how it may be ambiguous if you had dependencies where one command had[no-cd]
and the other didn't.Here are the commands I've written:
I'd like to consolidate it to something similar to:
Is there a way to do that?
Beta Was this translation helpful? Give feedback.
All reactions