aboutsummaryrefslogtreecommitdiff
path: root/node_modules/gulp-debug/index.js
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2018-09-20 02:56:13 +0200
committerFlorian Dold <florian.dold@gmail.com>2018-09-20 02:56:13 +0200
commitbbff7403fbf46f9ad92240ac213df8d30ef31b64 (patch)
treec58400ec5124da1c7d56b01aea83309f80a56c3b /node_modules/gulp-debug/index.js
parent003fb34971cf63466184351b4db5f7c67df4f444 (diff)
update packages
Diffstat (limited to 'node_modules/gulp-debug/index.js')
-rw-r--r--node_modules/gulp-debug/index.js27
1 files changed, 15 insertions, 12 deletions
diff --git a/node_modules/gulp-debug/index.js b/node_modules/gulp-debug/index.js
index ce720ab38..1a6c70fe0 100644
--- a/node_modules/gulp-debug/index.js
+++ b/node_modules/gulp-debug/index.js
@@ -1,6 +1,6 @@
'use strict';
const path = require('path');
-const gutil = require('gulp-util');
+const fancyLog = require('fancy-log');
const through = require('through2');
const tildify = require('tildify');
const stringifyObject = require('stringify-object');
@@ -9,40 +9,43 @@ const plur = require('plur');
const prop = chalk.blue;
-module.exports = opts => {
- opts = Object.assign({
+module.exports = options => {
+ options = Object.assign({
title: 'gulp-debug:',
minimal: true,
showFiles: true
- }, opts);
+ }, options);
if (process.argv.indexOf('--verbose') !== -1) {
- opts.verbose = true;
- opts.minimal = false;
- opts.showFiles = true;
+ options.verbose = true;
+ options.minimal = false;
+ options.showFiles = true;
}
let count = 0;
return through.obj((file, enc, cb) => {
- if (opts.showFiles) {
+ if (options.showFiles) {
const full =
'\n' +
(file.cwd ? 'cwd: ' + prop(tildify(file.cwd)) : '') +
(file.base ? '\nbase: ' + prop(tildify(file.base)) : '') +
(file.path ? '\npath: ' + prop(tildify(file.path)) : '') +
- (file.stat && opts.verbose ? '\nstat: ' + prop(stringifyObject(file.stat, {indent: ' '}).replace(/[{}]/g, '').trim()) : '') +
+ (file.stat && options.verbose ? '\nstat: ' + prop(stringifyObject(file.stat, {indent: ' '}).replace(/[{}]/g, '').trim()) : '') +
'\n';
- const output = opts.minimal ? prop(path.relative(process.cwd(), file.path)) : full;
+ const output = options.minimal ? prop(path.relative(process.cwd(), file.path)) : full;
- gutil.log(opts.title + ' ' + output);
+ module.exports._log(options.title + ' ' + output);
}
count++;
cb(null, file);
}, cb => {
- gutil.log(opts.title + ' ' + chalk.green(count + ' ' + plur('item', count)));
+ module.exports._log(options.title + ' ' + chalk.green(count + ' ' + plur('item', count)));
cb();
});
};
+
+// Internal: Log function used by gulp-debug exposed for testing
+module.exports._log = fancyLog;