Open
Description
Have you read the Contributing Guidelines on issues?
- I have read the Contributing Guidelines on issues.
Description
Running through the i18n tutorial the cp
commands under "Translate Markdown Files" were giving unexpected results.
cp -r docs/** i18n/fr/docusaurus-plugin-content-docs/current
In some shells, mine included, this leads to duplicate files because the shell globs all the files in all the subdirectories first and then recursively copies each one individually to the destination. So I end up with
api/file1.md
type/file2.md
file1.md
file2.md
Suspect globbing is used at all because in a later command we only want to include md and mdx files, so straight recursion would be too blunt an instrument:
cp -r src/pages/**.md i18n/fr/docusaurus-plugin-content-pages
Realise these commands are probably meant to be as simple as possible, though they could cause confusion for someone who doesn't twig to -r and ** doing similar things. Would like to hear any thoughts before suggesting a PR to fix. Would it be better to:
- change the commands to only use recursion OR globbing if possible
- use other utilities like find or cpio which may look more daunting but work more predictably
- add a warning message and link to more info "if you see duplicate files in the destination directory"
Self-service
- I'd be willing to address this documentation request myself.