Skip to content

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

Closed
@ETiV

Description

@ETiV

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions