MCPcopy Create free account
hub / github.com/McNull/angular-block-ui / copyCleanDirs

Function copyCleanDirs

gulp-tasks/module-tasks/copy-task.js:61–85  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

59 });
60
61 function copyCleanDirs() {
62 var outputFiles = [
63 path.join(module.folders.dest, '**/*')
64 ].concat(ignoreGlob);
65
66 return gulp.src(outputFiles, { read: false })
67 .pipe(filter(function (file) {
68 // Only include directories
69 return !isFile(file);
70 }))
71 .pipe(sort(function (fileA, fileB) {
72 // Reorder directories -- deepest first
73
74 var a = fileA.path.split(path.sep).length;
75 var b = fileB.path.split(path.sep).length;
76
77 return b - a;
78 }))
79 .pipe(filter(function (file) {
80 // Only empty directories
81 var files = fs.readdirSync(file.path);
82 return !files || files.length == 0;
83 }))
84 .pipe(clean({ force: true }));
85 }
86
87 module.task('copy-clean-dirs', ['copy-clean'], copyCleanDirs);
88

Callers

nothing calls this directly

Calls 1

isFileFunction · 0.85

Tested by

no test coverage detected