Commit cd0a8c3b authored by Guillaume Perréal's avatar Guillaume Perréal
Browse files

Affiche le chemin complet des fichiers dans les logs.

parent c5e1f1bd
import logger from "gulplog"; import logger from "gulplog";
import { obj } from "through2"; import { obj } from "through2";
import { relative } from "path";
export default function spy(limit = 5) { export default function spy(limit = 5) {
let count = 0; let count = 0;
return obj(function(file, _enc, next) { return obj(function(file, _enc, next) {
count++;
this.push(file); this.push(file);
next(); next();
if (file.isDirectory() || ++count > limit) {
if (count > limit) {
return; return;
} }
const input = file.history[0]; logger.info("%s -> %s", file.history[0], file.path);
const output = file.path;
logger.info("%s -> %s", relative(file.cwd, input), relative(file.cwd, output));
}, (next) => { }, (next) => {
next(); next();
if (count > limit) { if (count > limit) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment