Description
I'm submitting the ability to download private repos as a separate issue from #14 because I'm not sure how or if you would like to use it. I made a minor release (non-breaking) change to flipxfx/download-git-repo that allows for private repos.
You can still doing the following for a normal http download:
download('owner/repo', 'tmp', function(err) {})
But the new version allows you to use git-clone to download both public and private repos.
download('owner/repo', 'tmp', { clone: true }, function(err) {})
The problem is that using git clone
can be a bit slower (at least for Bitbucket). Due to this I'm not sure if the better way would be to use clone for all template downloads or if there should be an option to specify clone in the cli itself. It's not a ton slower but I didn't want to assume you were ok with the additional time to enable private repo downloads.
These are my stats from the tests in flipxfx/download-git-repo showing http download vs clone.
via github
✓ downloads the master branch by default (881ms)
✓ download branches too (428ms)
✓ downloads from github by default (734ms)
✓ clones the master branch by default (592ms)
✓ clones branches too (651ms)
via bitbucket
✓ downloads the master branch by default (189ms)
✓ download branches too (175ms)
✓ clones the master branch by default (1370ms)
✓ clones branches too (2040ms)