Skip to content
This repository has been archived by the owner on Sep 6, 2019. It is now read-only.

A gulp plugin to sync 2 directories which actually works

License

Notifications You must be signed in to change notification settings

peteward44/gulp-directory-sync

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gulp-directory-sync

This project is no longer maintained

A gulp plugin to sync 2 directories which actually works

npm install gulp-directory-sync --save-dev
var dirSync = require( 'gulp-directory-sync' );
var gutil = require('gulp-util');

gulp.task( 'sync', function() {
	return gulp.src( '' )
		.pipe(dirSync( 'my_source_dir', 'my_dest_dir', { printSummary: true } ))
		.on('error', gutil.log);
} );

Supports the following options in the 3rd parameter:

- printSummary : (Boolean) Prints to console what has changed - (Function) Allows custom result logging
	dirSync( 'my_source_dir', 'my_dest_dir', { printSummary: true } ) // outputs default message
	dirSync( 'my_source_dir', 'my_dest_dir', {
		printSummary: function( result ) {
			gutil.log( 'Dir Sync: ' + result.created + ' files created, ' + result.updated + ' files updated, ' + result.removed + ' items deleted, ' + result.same + ' files unchanged' );
		}
	} )
- nodelete : Doesn't delete files from the dst folder, only copies
- ignore : Either a string, regex, or function to determine if a file should be processed. eg.
	dirSync( 'my_source_dir', 'my_dest_dir', { ignore: /^\.svn$/i } ) // regex ignoring all .svn folders
	dirSync( 'my_source_dir', 'my_dest_dir', { ignore: function( dir, file ) { return file === '.svn'; } } ) // function ignoring all .svn folders
	dirSync( 'my_source_dir', 'my_dest_dir', { ignore: '.svn' } } ) // string ignoring all .svn folders
	dirSync( 'my_source_dir', 'my_dest_dir', { ignore: [ /^\.svn$/i, '.git' ] } } ) // use an array to specify multiple filters

About

A gulp plugin to sync 2 directories which actually works

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •