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

[docs] Make command work on both Linux and Windows #8704

Closed
wants to merge 4 commits into from

Conversation

Zenahr
Copy link
Contributor

@Zenahr Zenahr commented Feb 23, 2023

Change command to backslash so it works on both Linux and Windows machines. Trying to run the command as is results in a syntax error on Windows.

Pre-flight checklist

  • I have read the Contributing Guidelines on pull requests.
  • If this is a code change: I have written unit tests and/or added dogfooding pages to fully verify the new behavior.
  • If this is a new API or substantial change: the PR has an accompanying issue (closes #0000) and the maintainers have approved on my working plan.

Motivation

Test Plan

Test links

Deploy preview: https://deploy-preview-_____--docusaurus-2.netlify.app/

Related issues/PRs

#8703

Change command to backslash so it works on both Linux and Windows machines.
Trying to run the command as is results in a syntax error on Windows.
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Feb 23, 2023
@Zenahr
Copy link
Contributor Author

Zenahr commented Feb 23, 2023

Correction: the command cp -r docs\** i18n\fr\docusaurus-plugin-content-docs\current doesn't work on Windows.
I'm getting a cp: cannot stat 'docs**': No such file or directory error.

@netlify
Copy link

netlify bot commented Feb 23, 2023

[V2]

Built without sensitive environment variables

Name Link
🔨 Latest commit 4aeae34
🔍 Latest deploy log https://app.netlify.com/sites/docusaurus-2/deploys/63fc78449fbbbe00080659db
😎 Deploy Preview https://deploy-preview-8704--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 site settings.

@github-actions
Copy link

github-actions bot commented Feb 23, 2023

⚡️ Lighthouse report for the deploy preview of this PR

URL Performance Accessibility Best Practices SEO PWA Report
/ 🟠 85 🟢 97 🟢 100 🟢 100 🟢 90 Report
/docs/installation 🟠 73 🟢 100 🟢 100 🟢 100 🟢 90 Report

@Zenahr
Copy link
Contributor Author

Zenahr commented Feb 23, 2023

We might want to add a small text describing what the code snippet does too. Just a thought.

@slorber
Copy link
Collaborator

slorber commented Feb 23, 2023

We could use tabs if you can find another command that do the same for windows?

@Zenahr
Copy link
Contributor Author

Zenahr commented Feb 23, 2023

We could use tabs if you can find another command that do the same for windows?

Yep, I was thinking that. I'll add that in.

@Zenahr
Copy link
Contributor Author

Zenahr commented Feb 27, 2023

@slorber my PR LGTM now. The commands now show up in tabs and the Windows commands work on Windows.

@Zenahr
Copy link
Contributor Author

Zenahr commented Feb 27, 2023

Related to #8703

@Zenahr
Copy link
Contributor Author

Zenahr commented Feb 27, 2023

One note on the Xcopy docs i18n\fr\docusaurus-plugin-content-docs\current /E /C /I /D command: This opens a prompt for all files. I haven't yet found a flag for declining (no to all). /Y exists, for accepting all prompts, which we don't want here though I think as this would replace all already translated files.

We might have to separate the translation workflow out into first time and continued translations.

Copy link
Collaborator

@slorber slorber left a comment

Choose a reason for hiding this comment

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

That looks a bit complex just to copy files 😅

What about using a nodejs package that works the same on both platforms?

npx cpy-cli 'docs/**' 'i18n/fr/docusaurus-plugin-content-docs/current'

https://github.com/sindresorhus/cpy-cli

@Zenahr
Copy link
Contributor Author

Zenahr commented Mar 2, 2023

@slorber I agree...
I'll look at cpy-cli and update the PR. Thanks for the suggestion!

Comment on lines +397 to +398
mkdir -p i18n\fr\docusaurus-plugin-content-docs\current
cp -r docs\** i18n\fr\docusaurus-plugin-content-docs\current
Copy link
Contributor

@armano2 armano2 May 3, 2023

Choose a reason for hiding this comment

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

this command is working fine on windows as long as you use powershell instead of cmd

image

tested in PowerShell 7.3.4

https://learn.microsoft.com/en-us/powershell/

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree with Sebastién that a single, cross-platform command would be best. See here: #8704 (review)

@slorber slorber marked this pull request as draft May 3, 2023 16:27
@AshwanthramKL
Copy link

Hey @Zenahr, is there anyway I can help with this?

@slorber
Copy link
Collaborator

slorber commented Jun 14, 2023

closing until someone comes up with a simple PR

@slorber slorber closed this Jun 14, 2023
@0xSaksham
Copy link

@slorber I believe this issue is closed for a simple PR, should I work on it?

@slorber
Copy link
Collaborator

slorber commented Jul 31, 2023

Not sure what you mean @0xSaksham

you can submit a new PR taking into consideration my existing review on this PR

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.

6 participants