Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing files from the collection using patterns #119

Open
daliboris opened this issue May 9, 2023 · 2 comments
Open

Removing files from the collection using patterns #119

daliboris opened this issue May 9, 2023 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@daliboris
Copy link

Enhancement

I didn't find an example for deleting a list of files using wildcards in the Readme, and maybe it's not implemented yet.

I tried wildcards in the path: xst remove /db/apps/%project%-data/data/dictionaries/*.xml

I also tried -i parameter of the upload command: xst remove -i "*.xml" /db/apps/%project%-data/data/dictionaries/

Both commands failed.

Alternatives

Only the full name of the document being removed worked: xst remove /db/apps/%project%-data/data/dictionaries/pages_157_159.xml

@daliboris daliboris added the enhancement New feature or request label May 9, 2023
@line-o
Copy link
Member

line-o commented Oct 8, 2023

You are right @daliboris this is not implemented yet.
Globbing can only work when the path argument(s) are quoted. At least on linux shells this would otherwise lead to errors because the glob would not match any files on the local filesystem.
Therefore --include and --exclude are the safer options.

@line-o
Copy link
Member

line-o commented Oct 8, 2023

Remove all JavaScript resources in a collection

xst rm /db/apps/myapp --include "*.js"

Remove all files but JavaScript resources in a collection

xst rm /db/apps/myapp --exclude "*.js"

Remove everything recursively that starts with "temp-" (non-empty collections will not be removed)

xst rm -r /db/apps/myapp --include "temp-*"

This might warrant the addition of a --dry-run option to the rm command due to the damage that one might inflict on a db.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants