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

Tree magic misidentifies mimetype as application/octet-stream #214

Open
xiaoniu-578fa6bff964d005 opened this issue Mar 6, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@xiaoniu-578fa6bff964d005
Copy link

xiaoniu-578fa6bff964d005 commented Mar 6, 2024

Describe the bug

rga --rga-adapters=zip --rga-accurate doesn't work for zip file on macOS.

To Reproduce

Attach example file:
new.zip

Run command:
RUST_LOG=debug rga --rga-adapters=zip --rga-accurate --rga-no-cache -l 2018
Output

rg: new.zip: preprocessor command failed: '"/opt/homebrew/bin/rga-preproc" "new.zip"':
-------------------------------------------------------------------------------
[2024-03-06T16:00:29Z DEBUG ripgrep_all::config] Config: {"$schema":"./config.v1.schema.json","accurate":true,"adapters":["zip"],"cache":{"disabled":true},"custom_adapters":[]}
[2024-03-06T16:00:29Z DEBUG ripgrep_all::preproc] path (hint) to preprocess: ".../test/new.zip"
[2024-03-06T16:00:29Z DEBUG ripgrep_all::adapters] Chosen available adapters: zip
[2024-03-06T16:00:29Z DEBUG ripgrep_all::preproc] Archive recursion depth: 0
[2024-03-06T16:00:29Z DEBUG ripgrep_all::preproc] mimetype: "application/octet-stream"
[2024-03-06T16:00:29Z DEBUG ripgrep_all::preproc] Chose adapter 'postprocprefix' because of matcher Fast(FileExtension("default"))
.../test/new.zip adapter: postprocprefix
Error: during preprocessing

Caused by:
    0: run_adapter(.../test/new.zip)
    1: No cache?

Screenshots
If applicable, add screenshots to help explain your problem.

Operating System and Version
macOS 14.2.1

Output of rga --version
ripgrep-all 0.10.6

Other
related bug: aahancoc/tree_magic/issues/6
I find that mimetype is correct on Linux.

@xiaoniu-578fa6bff964d005 xiaoniu-578fa6bff964d005 added the bug Something isn't working label Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant