P
P
Peter2016-01-21 23:37:42
gulp.js
Peter, 2016-01-21 23:37:42

How to migrate directories without certain files using gulp?

There is a structure:
├── root-folder
│ ├── folder-one
│ ├── folder-two
│ ├── some-file.js
│ └── some-file.json
I only need to transfer from the root-folder directory directories with their internals (directories and files), and files (in this case some-file.js and some-file.json) should not be transferred.
How to do this with gulp?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Strukov, 2016-01-22
@volkov_p_v

gulp.task('replace', function(){
    return gulp.src(['path-to-root-folder/**', '!path-to-root-folder/*.+(js|json)'])
        .pipe(gulp.dest('path/to/destination/folder'));

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question