Refactor repo type handling in download-deps.js#24
Open
finscn wants to merge 1 commit intococos:v4.0.0from
Open
Refactor repo type handling in download-deps.js#24finscn wants to merge 1 commit intococos:v4.0.0from
finscn wants to merge 1 commit intococos:v4.0.0from
Conversation
Refactor getGitUrl and getNormalizedOrigin functions to handle different repo types more clearly.
目前的版本只支持 git 或者 url+'.git' 不够通用.
不支持 纯https 的 url 形式.
本修改解决了这个问题.
现在可以用下面这种格式的 配置了:
```json
{
"from": {
"type": "https",
"url": "https://aaa.bbb/cccc/dddd/eeee/my-external",
"checkout": "branch-test"
}
}
```
```
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refactor getGitUrl and getNormalizedOrigin functions to handle different repo types more clearly.
目前的版本只支持 git 或者 url+'.git' 不够通用.
不支持 纯https 的 url 形式.
本修改解决了这个问题.
现在可以用下面这种格式的 配置了:
{ "from": { "type": "https", "url": "https://aaa.bbb/cccc/dddd/eeee/my-external", "checkout": "branch-test" } }其实理论上可以省略 type , 判断如果没有 type 且有 url 时, 直接使用 url.
但是我看你们的代码里 没有type 会抛出异常, 也就是说 在你们的原始设计里 type 是必选项. 所以我也就保留了type.
虽然有点冗余, 但是挺清晰, 也没什么不好.
Re: #
Changelog
Continuous Integration
This pull request:
Compatibility Check
This pull request: