Skip to content

Commit

Permalink
pass cli arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
dimaslanjaka committed Oct 19, 2023
1 parent 89113e2 commit c14175a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion gulpfile.build.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const yaml = require('yaml');
const gch = require('git-command-helper');
/** @type {typeof import('./_config.json')} */
const config = yaml.parse(fs.readFileSync(__dirname + '/_config.yml', 'utf-8'));
const args = require('./config/cli');

const configExcludes = array_unique([
'.gitignore',
Expand Down Expand Up @@ -72,7 +73,10 @@ gulp.task('watch-build', () => {
building = false;
}
};
const watcher = gulp.watch(['src/**/*.*', 'public/**/*.*', 'source/**/*.*', 'config/**/*.*', 'html/**/*.*'], {
let patterns = ['src/**/*.*', 'public/**/*.*', 'source/**/*.*', 'config/**/*.*', 'html/**/*.*'];
// change watch files by -p=patterns comma separated
if (args.p) patterns = String(args.p).split(',');
const watcher = gulp.watch(patterns, {
ignored: ['**/node_modules', '**/posts/**', '**/_data/**', '**/_posts/**', '**/post-images/**', '**/tmp/**']
});
watcher.on('change', (filename, _stat) => {
Expand Down

0 comments on commit c14175a

Please sign in to comment.