Comments (6)
If --include is used without an --exclude, always append '--exclude=*' as it will not work otherwise
Does it depend what you expect --include
to do? Both your examples ended up syncing the .txt files that were requested.
man rsync
says:
--include=PATTERN don't exclude files matching PATTERN
Exclude before include makes sense
from legacy-cli.
Does it depend what you expect
--include
to do? Both your examples ended up syncing the .txt files that were requested.
Yes, that's intended for rsync
, but our help message mentions:
--include=INCLUDE File(s) to include in the download (pattern) (multiple values allowed)
Personally, I would expect --include
to only include the given pattern.
from legacy-cli.
- Include --exclude argument before --include
It looks like we already do this part:
legacy-cli/src/Service/Rsync.php
Lines 131 to 134 in 7fa4b45
from legacy-cli.
Yes, you're correct. I messed up the order - it seems like the correct order is the opposite one (include before exclude).
PLATFORMSH_CLI_DEBUG=1 platform mount:download -m .cache --target .cache --yes --include='*.txt' --exclude='*'
...
# Running command: 'rsync' '--archive' '--compress' '--human-readable' '-vv' 'XXX:.cache/' '.cache' '--exclude=*' '--include=*.txt'
...
[sender] hiding file one.txt because of pattern *
[sender] hiding file two.pdf because of pattern *
What we'd like to do is:
'rsync' '--archive' '--compress' '--human-readable' '-vv' 'XXX:.cache/' '.cache' '--include=*.txt' '--exclude=*'
...
[sender] showing file one.txt because of pattern *.txt
[sender] hiding file two.pdf because of pattern *
from legacy-cli.
OK reading deeper in the man page:
The order of the rules is important because the first rule that matches is the one that takes effect. Thus, if an early rule excludes a file, no include rule that comes after it can have any effect. This means that you must place any include overrides somewhere prior to the exclude that it is intended to limit.
from legacy-cli.
I've updated the PR #1304 to address that
from legacy-cli.
Related Issues (20)
- Feature Request: Add property `automated` to available fields in `backup:list`
- Feature Request: Delete backups
- Question: Is it possible to run platform auth:api-token-login non-interactively HOT 2
- Provide better error message when git fetching without PHP HOT 2
- The platform CLI seems to remove itself after upgrading from 3.88.1
- Migrate check should follow symlinks HOT 3
- Error when adding a custom domain on a non-production env HOT 2
- Error when deleting a non-production domain
- Typo in platform scp help message
- The `list` command: the `--all` option doesn't work for `json` and `md` formats
- Replace deprecated phone verification endpoint
- Installing the phar file to /usr/local/bin fails "The directory is not writeable: /usr/local/bin" HOT 2
- Github integration: create a branch does not push new branch to GH
- `platform environment:resume` returns an error if the project is not paused HOT 1
- Update resources commands for version 25
- File-based locking fails on the very first run HOT 1
- Add mention about disk size when syncing 2 environments
- Flexible resources improvements with Git 25 HOT 1
- Support step-up authentication
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from legacy-cli.