Gulp.src Glob Won't Copy .csscomb.json File

- 1 answer

Ad

I am trying to copy .csscomb.json over to my dest folder. Everything works and copies over, but the .csscomb.json does not. When I gulp.src the name specifically - it works. Does anyone know why? I am thinking it has to do with the period at the beginning of the name.

Below is a paired down version of the Gulp Task. The .csscomb is in the root folder.

Doesn't work...

 gulp.task('copy', function() {
            gulp.src('./**/*')
                .pipe(gulp.dest('dest'))
                .pipe(notify('Folders Copied finished'));
        });

This works...

gulp.task('copy', function() {
            gulp.src('.csscomb.json')
                .pipe(gulp.dest('dest'))
                .pipe(notify('Folders Copied finished'));
        });

Also, when .csscomb is clumped in Gulp.src it doesn't work -

gulp.task('copy', function() {
        gulp.src(['**/*', '.csscomb.json',
                        '!*.html',
                        '!js/',
                        '!js/**',
                        '!dist/',
                        '!dist/**',
                        '!styles/',
                        '!styles/**',
                        '!img/',
                        '!img/**']'./**/*')
            .pipe(gulp.dest('dest'))
            .pipe(notify('Folders Copied finished'));
    });
Ad

Answer

Ad

glob() does list "hidden" files (files starting with . including the directories . and ..), but only if you explicitly ask it for. I guess it makes sense - as in you don't want all the hidden stuff with /.*

So for example... 'app/.htaccess'

Ad
source: stackoverflow.com
Ad