Skip to content

Commit 47e9d33

Browse files
authored
Info: Add application name to possible 'what' info (#4075)
1 parent 7c66ff4 commit 47e9d33

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

docs/recipe/deploy/info.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@ require 'recipe/deploy/info.php';
1313

1414
## Configuration
1515
### what
16-
[Source](https://github.com/deployphp/deployer/blob/master/recipe/deploy/info.php#L8)
16+
[Source](https://github.com/deployphp/deployer/blob/master/recipe/deploy/info.php#L9)
1717

1818
Defines "what" text for the 'deploy:info' task.
1919
Uses one of the following sources:
2020
1. Repository name
21+
2. Application name
2122
:::info Autogenerated
2223
The value of this configuration is autogenerated on access.
2324
:::
@@ -26,7 +27,7 @@ The value of this configuration is autogenerated on access.
2627

2728

2829
### where
29-
[Source](https://github.com/deployphp/deployer/blob/master/recipe/deploy/info.php#L20)
30+
[Source](https://github.com/deployphp/deployer/blob/master/recipe/deploy/info.php#L25)
3031

3132
Defines "where" text for the 'deploy:info' task.
3233
Uses one of the following sources:
@@ -43,7 +44,7 @@ The value of this configuration is autogenerated on access.
4344
## Tasks
4445

4546
### deploy\:info {#deploy-info}
46-
[Source](https://github.com/deployphp/deployer/blob/master/recipe/deploy/info.php#L29)
47+
[Source](https://github.com/deployphp/deployer/blob/master/recipe/deploy/info.php#L34)
4748

4849
Displays info about deployment.
4950

recipe/deploy/info.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,16 @@
55
// Defines "what" text for the 'deploy:info' task.
66
// Uses one of the following sources:
77
// 1. Repository name
8+
// 2. Application name
89
set('what', function () {
910
$repo = get('repository');
1011
if (!empty($repo)) {
1112
return preg_replace('/\.git$/', '', basename($repo));
1213
}
14+
$application = get('application');
15+
if (!empty($application)) {
16+
return $application;
17+
}
1318
return 'something';
1419
});
1520

0 commit comments

Comments
 (0)