gulpfile.js 593 B

12345678910111213141516171819202122232425262728293031
  1. var copy = require('../index');
  2. var gulp = require('gulp');
  3. var through = require('through2');
  4. gulp.task('default', copyFunction);
  5. function copyFunction ()
  6. {
  7. return gulp
  8. .src([' ./files/.*', './files/*.*' ])
  9. .pipe(copy('output/test', { prefix: 1 }))
  10. .pipe(verify());
  11. }
  12. function verify ()
  13. {
  14. var options = { objectMode: true };
  15. return through(options, write, end);
  16. function write (file, enc, cb)
  17. {
  18. console.log('file', file.path);
  19. cb(null, file);
  20. }
  21. function end (cb)
  22. {
  23. console.log('done');
  24. cb();
  25. }
  26. }