Skip to content

Commit d8713ce

Browse files
reckless: fix installation from local directories with subpaths
This could previously copy the parent directory of a plugin into the installed reckless directory, which was unnecessary.
1 parent 2811614 commit d8713ce

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tools/reckless

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1175,10 +1175,11 @@ def _install_plugin(src: InstInfo) -> Union[InstInfo, None]:
11751175
log.debug(f'{clone_path} already exists - deleting')
11761176
shutil.rmtree(clone_path)
11771177
if src.srctype == Source.DIRECTORY:
1178+
full_source_path = Path(src.source_loc) / src.subdir
11781179
log.debug(("copying local directory contents from"
1179-
f" {src.source_loc}"))
1180+
f" {full_source_path}"))
11801181
create_dir(clone_path)
1181-
shutil.copytree(src.source_loc, plugin_path)
1182+
shutil.copytree(full_source_path, plugin_path)
11821183
elif src.srctype in [Source.LOCAL_REPO, Source.GITHUB_REPO,
11831184
Source.OTHER_URL, Source.GIT_LOCAL_CLONE]:
11841185
# clone git repository to /tmp/reckless-...

0 commit comments

Comments
 (0)