-
Notifications
You must be signed in to change notification settings - Fork 49
Description
gulp-rsync does not seem to honor the times configuration option.
To replicate:
- Set the
commandoption to true for debugging - Set the
silentoption to false for debugging - Set the
archiveoption to either true or false (try both ways - it makes no difference) - Set the
silentoption to false (false overrides a behavior ofarchivebut is not mutually-exclusive in rsync)
Since you set command to true, you will see the command that is being run, and it will not include the --no-times long option
Expected behavior:
When the times configuration parameter is set to either true or false the corresponding --times/--no-times command line parameter should be set for rsync (either -t or --times to enable, or --no-times to disable). Note that setting archive to true sets the --times command line parameter to true internally within rsync, so having --archive and --times set at the same time is non-harmful, but redundant. However, having --archive and --no-times set at the same time is useful and perfectly valid.
Here is my entire gulp task:
gulp.task( 'copy-sources',
function( done )
{
gulp.src([
srcDir
])
.pipe(
rsync({
command: true, // set this to true to see the rsync command that will run
root: srcDir, // when set to the source code root, rsync will show '.' (cwd) as the source directory
hostname: dstHost,
destination: dstDir,
archive: true,
times: false,
silent: false, // set to true to make the console less chatty
shell: 'ssh',
clean: false, // set to false to leave "missing" files from the orgin alone on the destination. true to delete them (sync)
dryrun: false, // set to true to see what will be done without doing anything
recursive: true,
exclude: [ '.DS_Store', '.buildpath', '.externalToolBuilders', '.git',
'.gitignore', '.project',, '.settings', 'logs' ] // directories you don't want to sync
})
);
done();
}
);
Temporary workaround:
This is kludgy, and I'm sure you would do it differently, but I was able to insert this at line 81 of rsync.js to get the desired results:
if( undefined !== this._options.t && false === this._options.t ) {
args.push( "--no-times" );
}
It may be worth noting that the rsync command does not change to include either --times or the --no-times option using any combination of true or false for the archive or the times configuration option. The times configuration option seems to have zero effect on anything.
My particular use case requires all of the options supplied by archive except that I need to drop modification times, which I was able to achieve using the workaround that I wouldn't have had to implement if the times configuration option were working as expected.