kopia lustrzana https://github.com/micropython/micropython-lib
mip: Add support to mip install from GitLab.
Modify _rewrite_url() to allow mip install from `gitlab:` repository. Signed-off-by: Olivier Lenoir <olivier.len02@gmail.com>pull/848/head
rodzic
583bc0da70
commit
57cbc34840
|
@ -73,6 +73,18 @@ def _rewrite_url(url, branch=None):
|
|||
+ "/"
|
||||
+ "/".join(url[2:])
|
||||
)
|
||||
elif url.startswith("gitlab:"):
|
||||
url = url[7:].split("/")
|
||||
url = (
|
||||
"https://gitlab.com/"
|
||||
+ url[0]
|
||||
+ "/"
|
||||
+ url[1]
|
||||
+ "/-/raw/"
|
||||
+ branch
|
||||
+ "/"
|
||||
+ "/".join(url[2:])
|
||||
)
|
||||
return url
|
||||
|
||||
|
||||
|
@ -128,6 +140,7 @@ def _install_package(package, index, target, version, mpy):
|
|||
package.startswith("http://")
|
||||
or package.startswith("https://")
|
||||
or package.startswith("github:")
|
||||
or package.startswith("gitlab:")
|
||||
):
|
||||
if package.endswith(".py") or package.endswith(".mpy"):
|
||||
print("Downloading {} to {}".format(package, target))
|
||||
|
|
Ładowanie…
Reference in New Issue