Skip to content

Conversation

@poetryofcode
Copy link

Pre-flight checklist

Motivation

The i18n tutorial documentation contains shell commands that use both -r
(recursive) and ** (glob pattern) together, which causes duplicate files
to be created in certain shells like Fish. When the glob pattern **
expands before the -r flag processes, files get copied multiple times.

This was reported in issue #11158.

Test Plan

This is a documentation-only change. The fix can be verified by:

  1. Running the old command cp -r docs/** destination/ in Fish shell -
    observe duplicate files
  2. Running the new command cp -r docs/. destination/ - observe correct
    behavior with no duplicates

The new commands are standard POSIX-compliant and work consistently across
bash, zsh, and fish shells.

Test links

Related issues/PRs

The i18n tutorial and git workflow docs used `cp -r dir/**` which
causes duplicate files in shells like Fish where the glob expands
before the -r flag processes recursively.

Fix by:
- Using `cp -r dir/.` for recursive directory copies
- Removing -r and using single `*` for file pattern copies

Fixes facebook#11158

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@meta-cla
Copy link

meta-cla bot commented Jan 25, 2026

Hi @poetryofcode!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

@netlify
Copy link

netlify bot commented Jan 25, 2026

[V2]

Built without sensitive environment variables

Name Link
🔨 Latest commit 3f7f05d
🔍 Latest deploy log https://app.netlify.com/projects/docusaurus-2/deploys/697b95ec54b0410008339414
😎 Deploy Preview https://deploy-preview-11687--docusaurus-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@poetryofcode
Copy link
Author

CLA is signed.

@miaromero6401-bot
Copy link

miaromero6401-bot commented Jan 26, 2026 via email

@meta-cla meta-cla bot added the CLA Signed Signed Facebook CLA label Jan 26, 2026
@meta-cla
Copy link

meta-cla bot commented Jan 26, 2026

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@miaromero6401-bot
Copy link

miaromero6401-bot commented Jan 26, 2026 via email

cp -r src/pages/**.md i18n/fr/docusaurus-plugin-content-pages
cp -r src/pages/**.mdx i18n/fr/docusaurus-plugin-content-pages
cp src/pages/*.md i18n/fr/docusaurus-plugin-content-pages
cp src/pages/*.mdx i18n/fr/docusaurus-plugin-content-pages
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We want to copy pages in subfolders as well

Comment on lines 121 to 122
cp src/pages/*.md i18n/fr/docusaurus-plugin-content-pages
cp src/pages/*.mdx i18n/fr/docusaurus-plugin-content-pages
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We want to copy pages in subfolders as well

Use `cp -r src/pages/. dest` instead of separate glob commands,
matching the pattern already used for docs and blog copies.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed Signed Facebook CLA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cp commands in i18n tutorial create duplicate file (recursing AND globbing)

3 participants