yeoman / generator-polymer

Scaffold out a Polymer project
http://polymer-project.org
926 stars 149 forks source link

yo polymer:gh using SSL instead of HTTPS #248

Closed jshcrowthe closed 8 years ago

jshcrowthe commented 8 years ago

Today I decided I was going to try using yo polymer:gh to deploy my gh-pages branch for me to github (which is a heaven sent thing thank you much!). Unfortunately it threw the following error:

ssh: connect to host github.com port 22: Operation timed out

fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

As you can imagine everything else failed after that which was all sorts of fun. I did a little digging and found that you guys are using the SSH url instead of the HTTPS url. Unfortunately I don't have my SSH keys properly configured on this machine which caused the error. A little digging turned up this: https://help.github.com/articles/which-remote-url-should-i-use/ which makes me think that

https://github.com/yeoman/generator-polymer/blob/master/gh/templates/gp.sh#L23

Should be changed to:

git clone https://github.com/$org/$repo.git --single-branch

Thoughts?

jshcrowthe commented 8 years ago

I tested this locally and it worked great! However it doesn't seem like there are any existing tests around the gh generator so I can't validate any other tests.

robdodson commented 8 years ago

When you switched it over to https did it prompt you for login/password or are you already using a keychain helper?

I'm thinking that maybe it should ask the user which they would prefer to use 'SSH or HTTPS' as some folks prefer one vs the other

jshcrowthe commented 8 years ago

I already have a keychain helper associated with my local git so there was no login/password prompt for me. I'll have to spin up a fresh VM and test that. I'll post the results here when I get done.

I think a SSH/HTTPS prompt is a great idea. Probably the right way to go about addressing this issue.

jshcrowthe commented 8 years ago

I just finished doing the test on a VM (Ubuntu 15.10) and after switching over to HTTPS it did indeed prompt me for a password. That said I was unable to successfully deploy to the gh-pages branch before the change so there may still be issues there I will have to look some more.

I will put together a PR that prompts a user for SSH or HTTPS (I would prefer HTTPS to be the default but that's just me) as a proposal. Hopefully should have that in the next couple hours.