@@ -472,10 +472,9 @@ When doing interpolation of variables, Task will look for the below.
472
472
They are listed below in order of importance (e.g. most important first) :
473
473
474
474
- Variables declared in the task definition
475
- - Variables given while calling a task from another.
475
+ - Variables given while calling a task from another
476
476
(See [Calling another task](#calling-another-task) above)
477
- - Variables declared in the `vars:` option in the `Taskfile`
478
- - Variables available in the `Taskvars.yml` file
477
+ - Global variables (those declared in the `vars:` option in the Taskfile)
479
478
- Environment variables
480
479
481
480
Example of sending parameters with environment variables :
@@ -489,6 +488,7 @@ $ TASK_VARIABLE=a-value task do-something
489
488
Since some shells don't support above syntax to set environment variables
490
489
(Windows) tasks also accepts a similar style when not in the beginning of
491
490
the command.
491
+
492
492
` ` ` bash
493
493
$ task write-file FILE=file.txt "CONTENT=Hello, World!" print "MESSAGE=All done!"
494
494
` ` `
@@ -528,30 +528,6 @@ DEV_MODE: production
528
528
GIT_COMMIT: {sh: git log -n 1 --format=%h}
529
529
` ` `
530
530
531
- # ## Variables expansion
532
-
533
- Variables are expanded 2 times by default. You can change that by setting the
534
- ` expansions:` option. Change that will be necessary if you compose many
535
- variables together :
536
-
537
- ` ` ` yaml
538
- version: '3'
539
-
540
- expansions: 3
541
-
542
- vars:
543
- FOO: foo
544
- BAR: bar
545
- BAZ: baz
546
- FOOBAR: "{{.FOO}}{{.BAR}}"
547
- FOOBARBAZ: "{{.FOOBAR}}{{.BAZ}}"
548
-
549
- tasks:
550
- default:
551
- cmds:
552
- - echo "{{.FOOBARBAZ}}"
553
- ` ` `
554
-
555
531
# ## Dynamic variables
556
532
557
533
The below syntax (`sh:` prop in a variable) is considered a dynamic variable.
0 commit comments