neoeno / gulp-build-branch

Publish your build folder to a branch (like GitHub Pages)
MIT License
1 stars 1 forks source link

feat(.gitignore) add gitignore parameter #3

Open jakeleboeuf opened 9 years ago

jakeleboeuf commented 9 years ago

add an optional paramater to create a gitignore

This feature will allow an optional ignore parameter. It expects and array, and will automatically add the dist folder, node_modules, bower_components, and the ole .DS_Store.

// Use it like this:
gulp.task('theme', ['dist'], function() {
    return buildBranch({
        branch: 'production',
        ignore: ['.git', 'dist', 'node_modules', 'bower_components', '.DS_Store'],
        folder: 'dist'
    }, function(err) {
        if(err) {
        throw err;
    }
        console.log('Built!');
    });
});
neoeno commented 9 years ago

The code looks good, but can you share a little more about how you're using this module?

The way it's meant to work is that this module creates a new git repo in dist/ (by default) whose responsibility is to manage the contents of that folder. (Commits from that repo are then copied into the repo at /).

So it would seem unusual to have a dist/dist or a dist/node_modules, which seems to be what you're guarding against here. Am I missing something?