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

publish-gh-pages doesn't run at a Windows command prompt #1749

Closed
italicize opened this issue Aug 7, 2019 · 4 comments · Fixed by #1914
Closed

publish-gh-pages doesn't run at a Windows command prompt #1749

italicize opened this issue Aug 7, 2019 · 4 comments · Fixed by #1914
Labels
documentation The issue is related to the documentation of Docusaurus good first issue If you are just getting started with Docusaurus, this issue should be a good place to begin.

Comments

@italicize
Copy link
Contributor

italicize commented Aug 7, 2019

🐛 Bug Report

The publish-gh-pages script doesn't run at a Windows command prompt, with or without USE_SSH=true. The script runs in Git Bash. Why won't it run at a Windows command prompt?

Have you read the Contributing Guidelines on issues?

Yes

To Reproduce

At the Windows command prompt:

  1. cd to the website directory of a Docusaurus repository.
  2. Type GIT_USER=githubusername CURRENT_BRANCH=master USE_SSH=true npm run publish-gh-pages replacing githubusername and press Enter. (It fails on my system.)
  3. Type GIT_USER=githubusername CURRENT_BRANCH=master npm run publish-gh-pages replacing githubusername and press Enter. (It fails on my system.)

In Git Bash:

  1. cd to the website directory of a Docusaurus repository.
  2. Type GIT_USER=githubusername CURRENT_BRANCH=master USE_SSH=true npm run publish-gh-pages replacing githubusername and press Enter. (It fails on my system.)
  3. Type GIT_USER=githubusername CURRENT_BRANCH=master npm run publish-gh-pages replacing githubusername and press Enter. (It runs on my system.)

Expected behavior

Files in the build directory are copied to GitHub.

Actual Behavior

Files aren't copied to GitHub. An error message says, 'GIT_USER' is not recognized as an internal or external command, operable program or batch file. See the screen images.

SSH and HTTPS fail at the Windows command prompt:

publish-gh-pages-at-the-windows-command-prompt

SSH fails in Git Bash:

publish-gh-pages-in-git-bash-ssh

HTTPS runs in Git Bash:

publish-gh-pages-in-git-bash-html-start
. . .
publish-gh-pages-in-git-bash-html-end

Reproducible Demo

Test publish-gh-pages with any repository. My repository was from the Docusaurus tutorial. I copied the files in my local repository to this branch, https://github.com/italicize/doc-tutorial/tree/source.

@chenhaihong
Copy link

chenhaihong commented Aug 19, 2019

Same with u.

At Windows command prompt, this is good for me.

$ npx cross-env GIT_USER=chenhaihong CURRENT_BRANCH=master npm run publish-gh-pages

@endiliey
Copy link
Contributor

Accepting PR on the docs. The instruction was meant for Linux command line. The way environment variable works in window is different

@endiliey endiliey added documentation The issue is related to the documentation of Docusaurus hacktoberfest good first issue If you are just getting started with Docusaurus, this issue should be a good place to begin. labels Oct 28, 2019
@dylmye
Copy link
Contributor

dylmye commented Oct 29, 2019

I'll have a look at this today! :)

@dylmye
Copy link
Contributor

dylmye commented Oct 29, 2019

Does running cmd /C "set GIT_USER=githubusername && set CURRENT_BRANCH=master && set USE_SSH=true && npm run publish-gh-pages" work for you? LGTM. Thanks @italicize

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation The issue is related to the documentation of Docusaurus good first issue If you are just getting started with Docusaurus, this issue should be a good place to begin.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants