mirror of
https://github.com/esphome/esphome.git
synced 2024-11-25 00:18:11 +01:00
[config] Allow file: scheme for git external components (#6844)
This commit is contained in:
parent
cc217d8a83
commit
7143e9cd9e
1 changed files with 4 additions and 4 deletions
|
@ -1949,13 +1949,13 @@ def url(value):
|
|||
except ValueError as e:
|
||||
raise Invalid("Not a valid URL") from e
|
||||
|
||||
if not parsed.scheme or not parsed.netloc:
|
||||
raise Invalid("Expected a URL scheme and host")
|
||||
if parsed.scheme and parsed.netloc or parsed.scheme == "file":
|
||||
return parsed.geturl()
|
||||
raise Invalid("Expected a file scheme or a URL scheme with host")
|
||||
|
||||
|
||||
def git_ref(value):
|
||||
if re.match(r"[a-zA-Z0-9\-_.\./]+", value) is None:
|
||||
if re.match(r"[a-zA-Z0-9_./-]+", value) is None:
|
||||
raise Invalid("Not a valid git ref")
|
||||
return value
|
||||
|
||||
|
|
Loading…
Reference in a new issue