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

Fail properly when current branch is the same as the deployment one #716

Merged
merged 1 commit into from
Jun 2, 2018

Conversation

gustavohenke
Copy link
Contributor

Motivation

I actually wanted something else of the publish script, and was looking into submitting another PR.

Then I found this bug.

In the publish script, shelljs' command output that parses the current branch wasn't unwrapped nor trimmed.
This means that when checking if the deployment branch is the same as the current branch, it would be comparing master to { stdout: 'master\n', stderr: '', ...etc }. Which is false, of course -- so the script would continue and cause #406.

Have you read the Contributing Guidelines on pull requests?

Skimmed through it (it's 2am in Sydney now 😴), I expect it to be the same as most other OSS projects

Test Plan

Try publishing to an user/org site while you're on the master branch. Or to a project site when you're on gh-pages...

The boom 💥
Have you read any cryptic error messages today?
screen shot 2018-06-01 at 01 47 26

The fix 🤕
Ah, clear error message, fine! 😎
screen shot 2018-06-01 at 01 49 16

@facebook-github-bot
Copy link
Contributor

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up 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 the corporate CLA signed.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

@docusaurus-bot
Copy link
Contributor

docusaurus-bot commented May 31, 2018

Deploy preview for docusaurus-preview ready!

Built with commit 32f99c4

https://deploy-preview-716--docusaurus-preview.netlify.com

Otherwise it may contain a trailing \n
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label May 31, 2018
@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

Copy link
Contributor

@endiliey endiliey left a comment

Choose a reason for hiding this comment

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

I think this is good

Copy link
Contributor

@yangshun yangshun left a comment

Choose a reason for hiding this comment

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

Good stuff. Thanks so much!

@yangshun yangshun merged commit 93b2ebb into facebook:master Jun 2, 2018
@gustavohenke gustavohenke deleted the branch-check branch June 3, 2018 13:27
@endiliey endiliey mentioned this pull request Jun 4, 2018
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.

5 participants