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

add working-directory docs #2288

Merged
merged 5 commits into from
Aug 2, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -750,12 +750,15 @@ $ just --list --list-heading ''
### Working Directory

By default, recipes run with the working directory set to the directory that
contains the `justfile`.
contains the `justfile`. You can override working directory for all recipes
with `set working-directory := '...'`. The value is relative to the location
of the justfile.

The `[no-cd]` attribute can be used to make recipes run with the working
directory set to directory in which `just` was invoked.

```just
set working-directory := 'mydir'
@foo:
pwd

Expand All @@ -767,7 +770,7 @@ directory set to directory in which `just` was invoked.
```sh
$ cd subdir
$ just foo
/
/mydir
: just bar
/subdir
```
Expand Down