Skip to content

Commit a651b1a

Browse files
reckless: handle a direct source in the form of a git repo url
1 parent 307baf7 commit a651b1a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tools/reckless

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1303,6 +1303,12 @@ def location_from_name(plugin_name: str) -> (str, str):
13031303
if this looks like a filepath or URL and return that as well as the
13041304
plugin name."""
13051305
if not Path(plugin_name).exists():
1306+
try:
1307+
parsed = urlparse(plugin_name)
1308+
if parsed.scheme in ['http', 'https']:
1309+
return (plugin_name, Path(plugin_name).with_suffix('').name)
1310+
except ValueError:
1311+
pass
13061312
# No path included, return the name only.
13071313
return (None, plugin_name)
13081314

@@ -1336,6 +1342,7 @@ def install(plugin_name: str) -> Union[str, None]:
13361342
commit = None
13371343
# Is the install request specifying a path to the plugin?
13381344
direct_location, name = location_from_name(name)
1345+
src = None
13391346
if direct_location:
13401347
logging.debug(f"install of {name} requested from {direct_location}")
13411348
src = InstInfo(name, direct_location, None)
@@ -1346,7 +1353,6 @@ def install(plugin_name: str) -> Union[str, None]:
13461353
if src and src.srctype == Source.LOCAL_REPO:
13471354
src.srctype = Source.DIRECTORY
13481355
if not direct_location or not src:
1349-
log.debug(f"direct_location {direct_location}, src: {src}")
13501356
log.debug(f"Searching for {name}")
13511357
if search(name):
13521358
global LAST_FOUND

0 commit comments

Comments
 (0)