Add docs for justfile() and justfile_directory() (#726)

This commit is contained in:
Ralph Minderhoud 2020-11-19 19:20:12 -06:00 committed by GitHub
parent 1fc4842e4c
commit dae44f0024
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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.