Azure-Samples / azure-search-openai-demo-csharp

A sample app for the Retrieval-Augmented Generation pattern running in Azure, using Azure Cognitive Search for retrieval and Azure OpenAI large language models to power ChatGPT-style and Q&A experiences.
MIT License
612 stars 401 forks source link

Escaping the wildcard in bash causes the `'` to be passed in the argument value #289

Closed SvenAelterman closed 7 months ago

SvenAelterman commented 7 months ago

This issue is for a: (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

Run az upd from bash (e.g., in devcontainer) and observe that 0 files are processed by prepdocs.

Any log messages given by the failure

Processing 0 files...

Expected/desired behavior

All PDF files to be processed.

OS and Version?

Windows 11, WSL 2

Mention any other details that might be useful

Without enclosing the files parameter in ', bash will expand the wildcard and pass multiple values to files, but that's not supported by the PrepareDocs app. When enclosing the parameter value in ', those single quotes are included in the value, so the PrepareDocs app tries to find PDF files in the 'data directory with the pattern *.pdf', which of course doesn't exist.

There are multiple other issues in the prepdocs.sh file fixed too, such as correctly setting the args variable (in bash args = "x" is not the same as args="x", etc.).


Thanks! We'll be in touch soon.