-
Notifications
You must be signed in to change notification settings - Fork 500
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
Add [cd(DIR)]
attribute
#2082
Comments
Pointing out a usecase for this: it'd facilitate cross-platform support. The project I'm working on currently will likely be developed on both windows and linux. _cd_and_run dir *cmd:
just _cd_and_run-{{os()}} {{dir}} {{cmd}}
_cd_and_run-linux dir *cmd:
cd {{dir}} && {{cmd}}
_cd_and_run-macos dir *cmd:
cd {{dir}} && {{cmd}}
_cd_and_run-windows dir *cmd:
cd {{dir}}; {{cmd}} Even this is fairly imperfect, as it doesn't easily allow you to do things like adding a And adding things like [cd(/frontend)]
build:
npm run build |
I started working on this together with #2291. It works in simple cases: absolute path or relative path from current directory. I wonder though, where relative paths should actually be reconed from? Is there some precedent in just already which this feature should follow? What about modules? |
I think that relative paths should always be used relative to whatever would have been the working directory otherwise. |
Ok, I think that gives me enough direction, thanks. |
i think set working-directory globally and [cd(subdirectory/nested)] per command base would be good idea |
I've raised a PR to implement this. However, I've implemented it as |
Allow setting the working directory of a recipe to an arbitrary directory. Good first issue!
The text was updated successfully, but these errors were encountered: