Skip to content

Commit 1fd3334

Browse files
reckless: handle a direct source in the form of a git repo url
1 parent 8d76e15 commit 1fd3334

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
@@ -1305,6 +1305,12 @@ def location_from_name(plugin_name: str) -> (str, str):
13051305
if this looks like a filepath or URL and return that as well as the
13061306
plugin name."""
13071307
if not Path(plugin_name).exists():
1308+
try:
1309+
parsed = urlparse(plugin_name)
1310+
if parsed.scheme in ['http', 'https']:
1311+
return (plugin_name, Path(plugin_name).with_suffix('').name)
1312+
except ValueError:
1313+
pass
13081314
# No path included, return the name only.
13091315
return (None, plugin_name)
13101316

@@ -1338,6 +1344,7 @@ def install(plugin_name: str) -> Union[str, None]:
13381344
commit = None
13391345
# Is the install request specifying a path to the plugin?
13401346
direct_location, name = location_from_name(name)
1347+
src = None
13411348
if direct_location:
13421349
logging.debug(f"install of {name} requested from {direct_location}")
13431350
src = InstInfo(name, direct_location, None)
@@ -1348,7 +1355,6 @@ def install(plugin_name: str) -> Union[str, None]:
13481355
if src and src.srctype == Source.LOCAL_REPO:
13491356
src.srctype = Source.DIRECTORY
13501357
if not direct_location or not src:
1351-
log.debug(f"direct_location {direct_location}, src: {src}")
13521358
log.debug(f"Searching for {name}")
13531359
if search(name):
13541360
global LAST_FOUND

0 commit comments

Comments
 (0)