Skip to content

clone from private repository #525

Closed
@yangblink

Description

@yangblink

i use private gitlab, the vue-cli version is 2.8.2

if i clone with project-name like this

vue init -c gitlab.com:username/my-vue-template test

it show err:

vue-cli · Failed to download repo vuejs-templates/test: 'git clone' failed with status 128

it seems that the order of argument is wrong

use this cammnd is work fine

vue init -c test gitlab.com:username/my-vue-template 

and this

vue-init  gitlab.com:username/my-vue-template test

Activity

posva

posva commented on Jul 13, 2017

@posva
Member

From readme:

If you would like to download from a private repository use the --clone flag and the cli will use git clone so your SSH keys are used.

yangblink

yangblink commented on Jul 13, 2017

@yangblink
Author

@posva thanks for quick prompt
I mean it's should

# yes
vue init --clone my-project username/repo   # it's right on my mac

# no 
vue init --clone username/repo my-project  # vue will treate `my-project` as the repository addr

or it's just the bug of my commander module

reopened this on Jul 13, 2017
posva

posva commented on Jul 13, 2017

@posva
Member

I see the bug, I'll fix it

posva

posva commented on Jul 13, 2017

@posva
Member

I gave it a look but I don't understand why the order is being messed up when loading the args. Can you take a quick look @egoist , please?

posva

posva commented on Jul 13, 2017

@posva
Member

BTW, using the option at the end works as expected

mrcsmcln

mrcsmcln commented on Jul 17, 2017

@mrcsmcln

Not sure if this helps, but this appears to work (just replace vue init with vue-init):

vue-init -c gitlab:user/repo my-project
bajras

bajras commented on Jul 27, 2017

@bajras

Im having a similar kind of issue with the custom template and its hosted in my work's private bitbucket repo and get the following error:

vue-cli · Failed to download repo ssh://git@bitbucket.moo.com:7999/mac/vue-moo-webpack-boilerplate.git: 'git clone' failed with status 128

I tried all the mentioned steps:
vue init -c ssh://git@bitbucket.moo.com:7999/mac/vue-moo-webpack-boilerplate.git yay
vue init ssh://git@bitbucket.moo.com:7999/mac/vue-moo-webpack-boilerplate.git --clone yay

When I put in on a public Github repo it works fine but not sure why its not working with the private bitbucket repo?

When I do git clone bitbucket of the exact repo it works fine as so I can tell its not the connection issue with SSH.

git clone ssh://git@bitbucket.moo.com:7999/mac/vue-moo-webpack-boilerplate.git

Any help would be highly appreciated. Thanks.

mrcsmcln

mrcsmcln commented on Jul 27, 2017

@mrcsmcln

@bajras did you try replacing vue init with vue-init?

bajras

bajras commented on Jul 27, 2017

@bajras

@mrcsmcln yes, that didnt work either.

winnieBear

winnieBear commented on Jul 28, 2017

@winnieBear

me too, In Window OS. I pull a request fix the bug.

#  in Windows OS
vue-init -c gitlab:gitlab.host:user/repo project-name
lee-chase

lee-chase commented on Aug 16, 2017

@lee-chase

commander appears to be switching the order of the args.

vue init a b

Program.args[0] === a
Program.args[1] === b

vue init -c a b

Program.args[0] === b
Program.args[1] === a

Perhaps an iterating through an object with no guarantee of order.

lee-chase

lee-chase commented on Aug 16, 2017

@lee-chase

Running

vue init --clone a b

Causes Commander.prototype.parse to be run twice. First for 'vue' which results in '--clone a' being seen as an unknown parameter. The unknown parameters are then tacked back on in Commander.prototype.parseArgs.

Personally, I'd see this as a bug in Commander which could do better with named arguments. That said --clone is not a named argument, it is being used as a switch and Commander does not seem to support argumentless switches.

It is perhaps less confusing to suggest users use the following command

vue init --clone=true a b

10 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @yyx990803@posva@adamkpurdy@torsteinringnes@yangblink

        Issue actions

          clone from private repository · Issue #525 · vuejs/vue-cli