Skip to content
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
27 changes: 27 additions & 0 deletions docs/basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,33 @@ task my_task

Since `current_date` is overridden, the callback is never executed.

:::note
If you need to create a new configuration option based on the overridden one, use dynamic configuration syntax:

```php

set('dir_name', 'test');

set('uses_overridden_dir_name', function () {
return '/path/to/' . get('dir_name');
});

set('uses_original_dir_name', '/path/to/' . get('dir_name'));

task('my_task', function () {
writeln('Path: {{uses_overridden_dir_name}}');
writeln('Path: {{uses_original_dir_name}}');
});
```

```sh
$ dep my_task deployer.org -v -o dir_name="prod"
task my_task
[deployer.org] Path: /path/to/prod
[deployer.org] Path: /path/to/test
```
:::

---

By now, you should have a solid understanding of Deployer’s basics, from defining tasks and hosts to working with
Expand Down