gulp-print.js 677 B

12345678910111213141516171819202122232425262728293031
  1. // Generated by CoffeeScript 1.10.0
  2. var colors, green, log, magenta, map, path, print, ref;
  3. map = require('map-stream');
  4. path = require('path');
  5. ref = require('gulp-util'), log = ref.log, colors = ref.colors;
  6. green = colors.green, magenta = colors.magenta;
  7. print = function(format) {
  8. if (format == null) {
  9. format = function(filepath) {
  10. return filepath;
  11. };
  12. }
  13. return map(function(file, cb) {
  14. var filepath, formatted;
  15. filepath = magenta(path.relative(process.cwd(), file.path));
  16. formatted = format(filepath);
  17. if (formatted) {
  18. print.log(formatted);
  19. }
  20. return cb(null, file);
  21. });
  22. };
  23. print.log = log;
  24. module.exports = print;