mirror of
ssh://git.janware.com/janware/proj/jw-pkg
synced 2026-04-24 09:13:37 +02:00
lib.ExecContext.create(): Support path-only URIs
ExecContext.create() relies on properly formed URLs with a schema for deciding which backend gets created. Create a Local instance if an URL doesn't have schema. Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
04b294917f
commit
dbf41d7b48
1 changed files with 2 additions and 2 deletions
|
|
@ -289,9 +289,9 @@ class ExecContext(abc.ABC):
|
|||
@classmethod
|
||||
def create(cls, uri: str, *args, **kwargs) -> Self:
|
||||
tokens = re.split(r'://', uri)
|
||||
schema = tokens[0]
|
||||
schema = tokens[0] if tokens[0] != uri else 'file'
|
||||
match schema:
|
||||
case 'local':
|
||||
case 'local' | 'file':
|
||||
from .ec.Local import Local
|
||||
return Local(uri, *args, **kwargs)
|
||||
case 'ssh':
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue