Skip to content
This repository has been archived by the owner on Mar 14, 2023. It is now read-only.

Shouldn't ignore/rsync options be merged instead? #209

Open
tomsseisums opened this issue Aug 24, 2018 · 0 comments
Open

Shouldn't ignore/rsync options be merged instead? #209

tomsseisums opened this issue Aug 24, 2018 · 0 comments

Comments

@tomsseisums
Copy link

tomsseisums commented Aug 24, 2018

I required custom rsync options, and initially set up my config like:

shipit.initConfig({
  default: {
    /* .. */
    rsync: ['--no-p', '--no-o', '--no-g']
  }
})

Expecting the options to be passed, but actually here:

const copyOptions = { ...defaultOptions, ...options }

Spread operator doesn't merge, but overrides.

Thankfully, shipit-deploy provides entry point to extend:

const options = _.get(shipit.config, 'deploy.remoteCopy') || {

And yeah, changing my config to:

default: {
  deploy: {
    remoteCopy: {
      rsync: [/**/]
    }
  }
}

Works flawlessly!

Though! It seems to me, that copyOptions was intended to merge, instead of overwrite?

And in most cases it would, but since deploy.remoteCopy has a default, if I do not specify custom deploy.remoteCopy config, it uses the default ({ rsync: ['--del'] }), which, when spread in copyOptions would overwrite any rsync setting set in defaultOptions.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

1 participant