Skip to content

Commit

Permalink
Support rsync in config.
Browse files Browse the repository at this point in the history
  • Loading branch information
gregberge committed Apr 6, 2015
1 parent 188d8b1 commit 3ac2d9c
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ module.exports = function (shipit) {
deployTo: '/tmp/deploy_to',
repositoryUrl: 'https://github.com/user/repo.git',
ignores: ['.git', 'node_modules'],
rsync: ['--del'],
keepReleases: 2,
key: '/path/to/key',
shallowClone: true
Expand Down
3 changes: 2 additions & 1 deletion lib/shipit.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,8 @@ Shipit.prototype.remoteCopy = function (src, dest, options, callback) {
}

options = _.defaults(options || {}, {
ignores: this.config && this.config.ignores ? this.config.ignores : []
ignores: this.config && this.config.ignores ? this.config.ignores : [],
rsync: this.config && this.config.rsync ? this.config.rsync : []
});

return this.pool.copy(src, dest, options, callback);
Expand Down
18 changes: 17 additions & 1 deletion test/shipit.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,26 @@ describe('Shipit', function () {

expect(shipit.pool.copy).to.be.calledWith('src', 'dest', {
direction: 'remoteToLocal',
ignores: []
ignores: [],
rsync: []
});
});

it('should support options specified in config', function () {
shipit.config = {
ignores: ['foo'],
rsync: ['--bar']
};

shipit.remoteCopy('src', 'dest', {
direction: 'remoteToLocal'
});

expect(shipit.pool.copy).to.be.calledWith('src', 'dest', {
direction: 'remoteToLocal',
ignores: ['foo'],
rsync: ['--bar']
});
});
});
});

0 comments on commit 3ac2d9c

Please sign in to comment.