tilt-dev / tilt-extensions

Extensions for Tilt
https://tilt.dev/
Apache License 2.0
200 stars 156 forks source link

syncback `paths` option doesn't work for paths below the top level #567

Open pedantic-git opened 4 months ago

pedantic-git commented 4 months ago

By way of example, if I have this configuration in my Tiltfile:

syncback('sync lockfiles', 'deploy/name-pn', '/rails/', 
  paths=['db/schema.rb', 'Gemfile.lock', 'yarn.lock']
)

it will happily sync the Gemfile.lock and yarn.lock files but not the db/schema.rb file.

The reason for this is (I think) this behaviour -- the --exclude=* matches db/ before it has a chance to look inside that directory to find the db/schema.rb that it's trying to include.

I think the correct rsync syntax in this situation would be:

rsync --include=db --include=db/schema.rb [...] --exclude=*

It would be great if the parent --include filters were included automatically. I can have a go at a PR for this if you think it would be useful!

pedantic-git commented 4 months ago

Little update - I've created a PR that adds an rsync_options method and I'm using this to work around it (and also to prove it's working). That's in #568.