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

Throw better error for missing arguments on publish script #1025

Closed
alexdriedger opened this issue Oct 8, 2018 · 5 comments
Closed

Throw better error for missing arguments on publish script #1025

alexdriedger opened this issue Oct 8, 2018 · 5 comments
Labels
bug An error in the Docusaurus core causing instability or issues with its execution good first issue If you are just getting started with Docusaurus, this issue should be a good place to begin. help wanted Asking for outside help and/or contributions to this particular issue or PR. status: claimed Issue has been claimed by a contributor who plans to work on it.

Comments

@alexdriedger
Copy link
Contributor

🐛 Bug Report

I am trying to publish my site on Windows and yarn run publish-gh-pages and npm run publish-gh-pages fail in the same place

I have push access to the repository and can push from the command line.

Have you read the Contributing Guidelines on issues?

Yes

To Reproduce

  1. Initialize a new repo on windows
  2. Try to publish the repository

Expected behavior

The site would be published

Actual Behavior

Received this error (similar error with yarn as well)

 create mode 100644 sitemap.xml
error: cannot spawn sh: No such file or directory
error: cannot spawn sh: No such file or directory
error: failed to execute prompt script (exit code 255)
fatal: could not read Password for 'https://alexdriedger@github.com': No error
Error: Git push failed
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ publish-gh-pages: `docusaurus-publish`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ publish-gh-pages script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Reproducible Demo

(Paste the link to an example repo, including a siteConfig.js, and exact instructions to reproduce the issue.)

https://github.com/alexdriedger/SlayTheSpireModding

dowload the repo (https://github.com/alexdriedger/SlayTheSpireModding) and unzip
create a new github repo
git init
git add -A
git push -u origin master
yarn run publish-gh-pages
@endiliey
Copy link
Contributor

endiliey commented Oct 9, 2018

Check the docs. https://docusaurus.io/docs/en/publishing#docsNav

You need to set several environment variable as well.

Example:

GIT_USER=alexdriedger CURRENT_BRANCH=master USE_SSH=true yarn run publish-gh-pages

@endiliey
Copy link
Contributor

endiliey commented Oct 9, 2018

Will be accepting PR for this so that the correct error can be thrown.

Related files are https://github.com/facebook/Docusaurus/blob/master/v1/lib/publish-gh-pages.js

@endiliey endiliey changed the title Cannot Publish Site on Windows Throw better error for missing arguments on publish script Oct 13, 2018
@endiliey endiliey added bug An error in the Docusaurus core causing instability or issues with its execution help wanted Asking for outside help and/or contributions to this particular issue or PR. good first issue If you are just getting started with Docusaurus, this issue should be a good place to begin. mentorship labels Oct 13, 2018
@tanhauhau
Copy link
Contributor

@endiliey I would like to work on this

@yangshun
Copy link
Contributor

@tanhauhau it's yours!

I've added an "issue: claimed" label so that others will know not to start work on the issue. If you change your mind about the issue, no worries! Just let me know so that I can remove the label and free it up for someone else to claim.

I'll check in with you periodically so that we can keep the task updated with the progress.

@yangshun yangshun added the status: claimed Issue has been claimed by a contributor who plans to work on it. label Oct 13, 2018
tanhauhau added a commit to tanhauhau/Docusaurus that referenced this issue Oct 14, 2018
@tanhauhau
Copy link
Contributor

I couldn't replicate the exact error

fatal: could not read Password for 'https://alexdriedger@github.com': No error

but I see it's not complaining correctly by not requiring me to set GIT_USER

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An error in the Docusaurus core causing instability or issues with its execution good first issue If you are just getting started with Docusaurus, this issue should be a good place to begin. help wanted Asking for outside help and/or contributions to this particular issue or PR. status: claimed Issue has been claimed by a contributor who plans to work on it.
Projects
None yet
Development

No branches or pull requests

4 participants