Some improvements to #356

This commit is contained in:
Andrey Nering
2020-08-15 19:12:39 -03:00
parent 8b962fb8e8
commit eab14b6c49
3 changed files with 27 additions and 34 deletions

View File

@@ -35,8 +35,8 @@ If you omit a task name, "default" will be assumed.
## Environment variables
### Task
You can use `env` to set custom environment variables for a specific task:
```yaml
@@ -68,29 +68,20 @@ tasks:
> NOTE: `env` supports expansion and retrieving output from a shell command
> just like variables, as you can see on the [Variables](#variables) section.
### .env files
### Operating System
Environment variables from the OS are accessible using `$VARNAME`:
You can also ask Task to include `.env` like files by using the `dotenv:`
setting:
```yaml
version: '2'
tasks:
greet:
cmds:
- echo "Hello $USER"
```
### .env
*.env* files are supported in v3 using the `dotenv` declaration:
.env
```
# .env
KEYNAME=VALUE
```
Taskfile.yml
```yaml
# Taskfile.yml
version: '3'
dotenv: ['.env']