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

failed to init from github enterprise (with a custom hostname) repository #283

Closed
ETiV opened this issue Jan 3, 2017 · 9 comments
Closed
Assignees

Comments

@ETiV
Copy link

ETiV commented Jan 3, 2017

what happened

  1. command I use
vue init -c github:git.company.com:User/webpack-simple
  1. I expected the vue-cli clones the git repo from the specific URL to initiate a new project.

  2. but after answering the questions, it returns the following error:

vue-cli · Local template "git.company.com:User/webpack-simple" not found.

why it happens

I've checked the bin/vue-init file,
It seems like it's a conflict with the local template test, at here:
https://github.com/vuejs/vue-cli/blob/master/bin/vue-init#L93-L94

./ - for Linux CWD,
\w: - for Windows Disk Volume?

But it DO CONFLICT with the given argument,
because the download-git-repo doc says:

... you can also specify a custom host like gitlab:custom.com:owner/name. Feel free to submit an issue or pull request for additional host options.


In my case, I simply modified the file to bypass the local template testing:

#L94    if (!clone && /^[./]|(\w:)/.test(template)) {

Because I don't know how to exactly test the local template path(so many scenarios), so this is an issue instead of PR.

@likun7981
Copy link

you can change like this

/^\.{1,2}\/|^\w:|^\//.test(template) 

@ETiV
Copy link
Author

ETiV commented Jan 4, 2017

@likun7981

// it will be failed on
/^\.{1,2}\/|^\w:|^\//.test('templates/example')

@ETiV
Copy link
Author

ETiV commented Jan 4, 2017

layer

'templates/example' will be github.com/templates/example

I think it's better to add a switch to the command line arguments to specify whether to use a local template. Like:

vue init --local ${LOCAL_PATH}

@likun7981
Copy link

This is not wrong, 'templates/example' is not a local path , it should return false

@likun7981
Copy link

These tests are all right

var localPathRegx = /^\.{1,2}\/|^\w:|^\//  

localPathRegx.test('../')  //true
localPathRegx.test('./')  //true
localPathRegx.test('c:/') //true
localPathRegx.test('template/example')  //false
localPathRegx.test('github:git.company.com:User/webpack-simple')  //false

@zigomir
Copy link
Contributor

zigomir commented Feb 11, 2017

Should be fixed now with #341. (although, not yet released with atm).

@zigomir zigomir closed this as completed Feb 11, 2017
@edwardorz
Copy link

When #341 should be released? I cloned the latest vue-cli repo & installed it locally, but I still fail to init from the custom gitlab which I am using. It gets stuck when ⠙ downloading template

@zigomir
Copy link
Contributor

zigomir commented Mar 20, 2017

@edwardnevermind can't really say :/ but you can use npm install -g vuejs/vue-cli for now to install it directly from GitHub.

@winnieBear
Copy link

fail to init from the custom gitlab which I am using. It gets stuck when ⠙ downloading template

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants