Skip to content

Commit 23ffdda

Browse files
committed
fix: update DESCRIPTION message according to the description option
1 parent e422eb1 commit 23ffdda

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/shared/translate.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Timestamp.prototype[util.inspect.custom] = function (depth, opts) {
1717
return '[' + opts.stylize(timestamp, 'date') + ']';
1818
};
1919

20-
function getDefaultMessage(data) {
20+
function getDefaultMessage(data, cfg) {
2121
switch (data.tag) {
2222
case messages.PRELOAD_BEFORE: {
2323
return 'Preloading external module: ' + chalk.magenta(data.name);
@@ -58,6 +58,9 @@ function getDefaultMessage(data) {
5858
return chalk.red('Unsupported gulp version', data.version)
5959
}
6060
case messages.DESCRIPTION: {
61+
if (cfg.description && typeof cfg.description === 'string') {
62+
return cfg.description
63+
}
6164
return 'Tasks for ' + chalk.magenta(tildify(data.path));
6265
}
6366
case messages.GULPFILE: {
@@ -269,7 +272,7 @@ function buildTranslations(cfg) {
269272
// If the user hasn't returned a message or silenced it with `false`
270273
// get the default message. Will return the first argument if the message
271274
// is not defined in the `@gulpjs/messages` package
272-
return getDefaultMessage(data);
275+
return getDefaultMessage(data, cfg);
273276
},
274277
timestamp: function (data) {
275278
// Don't allow an `undefined` message through

0 commit comments

Comments
 (0)