You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Whenjust gaga ./myfileis executed in a subfolder /a/b/c of a /justfile it will change the working directory to this justfile's directory e.g. / and then execute the
target. Arguments given to the command might be relative file paths and these will then not work as intended, when suddenly the cwd is changed (there is also no documentation for this behavior AFAIK).
It would be nice to disable this behavior (ok its braking change I guess, or introduce a setting set cwd-to-current-justfile = false.
The text was updated successfully, but these errors were encountered:
Good noticing that there wasn't any documentation of this. I opened #2053 to rectify this.
This is a pretty fundamental behavior of just, and I think there are more pros for it than cons, although I see how this case is annoying.
You can use [no-cd] on a recipe, like @laniakea64 says, to change this behavior.
A potential feature that could be added is marking an argument as a path somehow, which would cause it to be joined with the invocation directory, making it an absolute path, and thus insensitive to the current directory:
@foobar~path:
echo {{bar}}
$ cd subdir
$ just foo hello/baz
/subdir/hello/baz
When
just gaga ./myfile
is executed in a subfolder/a/b/c
of a/justfile
it will change the working directory to this justfile's directory e.g./
and then execute thetarget. Arguments given to the command might be relative file paths and these will then not work as intended, when suddenly the cwd is changed (there is also no documentation for this behavior AFAIK).
It would be nice to disable this behavior (ok its braking change I guess, or introduce a setting
set cwd-to-current-justfile = false
.The text was updated successfully, but these errors were encountered: