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

使“umi block add” 命令可以添加局域网内搭建gitlab #2559

Closed
wants to merge 1 commit into from

Conversation

MI-Class
Copy link
Contributor

因为局域网内搭建的gitlab通常都是以IP地址开头,并没有域名,通过正则过滤部分添加了IP地址的过滤来使IP地址开头的gitlab地址也能符合isGitUrl()

因为局域网内搭建的gitlab通常都是以IP地址开头,并没有域名,通过正则过滤部分添加了IP地址的过滤来使IP地址开头的gitlab地址也能符合isGitUrl()
// or http://192.168.1.11/bigfish/bigfish-blocks/tree/master/demo
// or http://192.168.1.11/bigfish/testblocks/tree/master
// or http://192.168.1.11/bigfish/testblocks
const gitSiteParser = /^(https\:\/\/|http\:\/\/|git\@)((github[\.\w\-]+|gitlab[\.\w\-]+|((25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(25[0-5]|2[0-4]\d|[01]?\d\d?)))(\/|\:)([\w\-]+)\/([\w\-]+)(\/tree\/([\w\.\-]+)([\w\-\/]+))?(.git)?$/;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

建议用 https://www.npmjs.com/package/git-url-parse 重构,这样能解决各种情况。

@xiaohuoni
Copy link
Member

感觉这么加,这个条件都没什么作用了,直接去掉都更好的。
ip的地址是不是要用另一个变量判断会合理一些?

@yutingzhao1991
Copy link
Contributor

same with #2245

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

Successfully merging this pull request may close these issues.

5 participants