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 docs for justfile and justfile_directory functions #726

Merged
merged 2 commits into from
Nov 20, 2020
Merged
Changes from all commits
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
13 changes: 13 additions & 0 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,19 @@ build:
cd {{invocation_directory()}}; ./some_script_that_needs_to_be_run_from_here
```

==== Justfile and Justfile Directory

- `justfile()` - Retrieves the path of the current justfile.

- `justfile_directory()` - Retrieves the path of the parent directory of the current justfile.

For example, to run a command relative to the location of the current justfile:

```
script:
./{{justfile_directory()}}/scripts/some_script
```

==== Dotenv Integration

`just` will load environment variables from a file named `.env`. This file can be located in the same directory as your justfile or in a parent directory. These variables are environment variables, not `just` variables, and so must be accessed using `$VARIABLE_NAME` in recipes and backticks.
Expand Down