Skip to content

Commit

Permalink
Revert "shipit.config should be prioritized for remoteCopy command."
Browse files Browse the repository at this point in the history
This reverts commit 0ec98e8.
  • Loading branch information
Tim Kelty committed Jul 1, 2016
1 parent 68c5881 commit e54af19
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 20 deletions.
7 changes: 3 additions & 4 deletions lib/shipit.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,10 +240,9 @@ Shipit.prototype.remoteCopy = function (src, dest, options, callback) {
options = undefined;
}

options = options || {};
options = _.assign({}, options, {
ignores: this.config && this.config.ignores ? this.config.ignores : options.ignores || [],
rsync: this.config && this.config.rsync ? this.config.rsync : options.rsync || []
options = _.defaults(options || {}, {
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: 2 additions & 16 deletions test/shipit.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,14 @@ describe('Shipit', function () {
});
});

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

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

expect(shipit.pool.copy).to.be.calledWith('src', 'dest', {
Expand All @@ -122,18 +121,5 @@ describe('Shipit', function () {
rsync: ['--bar']
});
});

it('should support options specified in options parameter', function () {
shipit.remoteCopy('src', 'dest', {
direction: 'remoteToLocal',
rsync: '--foo'
});

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

0 comments on commit e54af19

Please sign in to comment.