Skip to content

Commit 27776e7

Browse files
author
reallyli
committed
update message notify style
1 parent 428a637 commit 27776e7

File tree

2 files changed

+15
-14
lines changed

2 files changed

+15
-14
lines changed

src/task/init.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,14 @@
2626
desc('Record revision log');
2727
task('record:revision:log', function () {
2828
$filePath = get('deploy_path') . '/revision.log';
29+
$date = '[' . date('Y-m-d H:i:s'). ']';
2930
$revisionMessage = join(',', [
30-
'[' . date('Y-m-d H:i:s'). ']',
3131
'branch:' . get('branch'),
3232
'environment:' . get('environment'),
3333
'user:' . get('user'),
3434
'last_commit_id:' . get('last_commit'),
3535
]);
3636

37-
return run('echo ' . $revisionMessage . ' >> ' . $filePath);
37+
run('echo ' . $date . $revisionMessage . ' >> ' . $filePath);
38+
writeln('record revision log successfully');
3839
});

src/task/notify.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,24 +26,24 @@ function sendGroupNotify(string $content)
2626
}
2727

2828
task('success:notify', function () {
29-
$successMessage = join('', [
30-
'🔚🔚Successfully released' . "\n",
31-
'environment: ' . get('environment') . "\n",
32-
'announcer: ' . get('user') . "\n",
33-
'branch: ' . get('branch') . "\n",
34-
'application: ' . get('application') . "\n"
29+
$successMessage = join("\n", [
30+
"\n 🔚🔚Successfully released",
31+
'environment: ' . get('environment'),
32+
'announcer: ' . get('user'),
33+
'branch: ' . get('branch'),
34+
'application: ' . get('application')
3535
]);
3636

3737
get('group_notify') ? sendGroupNotify($successMessage) : writeln($successMessage);
3838
})->local();
3939

4040
task('failed:notify', function () {
41-
$failedMessage = join('', [
42-
'🔙🔙Failed to release' . "\n",
43-
'environment: ' . get('environment') . "\n",
44-
'announcer: ' . get('user') . "\n",
45-
'branch: ' . get('branch') . "\n",
46-
'application: ' . get('application') . "\n"
41+
$failedMessage = join("\n", [
42+
"\n 🔙🔙Failed to release",
43+
'environment: ' . get('environment'),
44+
'announcer: ' . get('user'),
45+
'branch: ' . get('branch'),
46+
'application: ' . get('application')
4747
]);
4848

4949
get('group_notify') ? sendGroupNotify($failedMessage) : writeln($failedMessage);

0 commit comments

Comments
 (0)