Skip to content

Commit 1073ee5

Browse files
committed
Merge pull request #17 from flipxfx/master
Add --clone flag to download from private repos
2 parents 4226c3d + 69780d4 commit 1073ee5

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

Diff for: README.md

+2
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ Where `username/repo` is the GitHub repo shorthand for your fork.
4949

5050
The shorthand repo notation is passed to [download-git-repo](https://github.com/flipxfx/download-git-repo) so you can also use things like `bitbucket:username/repo` for a Bitbucket repo and `username/repo#branch` for tags or branches.
5151

52+
If you would like to download from a private repository use the `--clone` flag and the cli will use `git clone` so your SHH keys are used.
53+
5254
You can also create your own template from scratch:
5355

5456
- A template repo **must** have a `template` directory that holds the template files.

Diff for: bin/vue-init

+3-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ var getGitUser = require('../lib/git-user')
1919

2020
program
2121
.usage('<template-name> <project-name>')
22+
.option('-c, --clone', 'use git clone')
2223

2324
/**
2425
* Help.
@@ -60,6 +61,7 @@ var hasSlash = template.indexOf('/') > -1
6061
var name = program.args[1]
6162
var dir = program.directory
6263
var to = resolve(name)
64+
var clone = program.clone || false
6365
if (exists(to)) logger.fatal('"%s" already exists.', name)
6466

6567
/**
@@ -86,7 +88,7 @@ if (hasSlash && exists(template)) {
8688
*/
8789

8890
var tmp = '/tmp/vue-template-' + uid()
89-
download(template, tmp, function (err) {
91+
download(template, tmp, { clone: clone }, function (err) {
9092
if (err) logger.fatal(err)
9193
generate(tmp, to, function (err) {
9294
if (err) logger.fatal(err)

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"dependencies": {
2929
"chalk": "^1.1.1",
3030
"commander": "^2.9.0",
31-
"download-git-repo": "^0.0.1",
31+
"download-git-repo": "^0.1.1",
3232
"khaos-patched": "^0.9.3",
3333
"read-metadata": "^1.0.0",
3434
"request": "^2.67.0",

0 commit comments

Comments
 (0)