Skip to content

Commit

Permalink
Merge pull request #10164 from archesproject/10160-load-package-targe…
Browse files Browse the repository at this point in the history
…t-dir

Place JSON configs for card components etc in correct place #10160
  • Loading branch information
chiatt authored Oct 24, 2023
2 parents 0fb58e8 + 20c7e3b commit 4547d12
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion arches/management/commands/packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -802,10 +802,12 @@ def load_extensions(package_dir, ext_type, cmd):
modules.extend(glob.glob(os.path.join(extension, "*.py")))

if len(modules) > 0:
if os.path.exists(module_dir) is False:
os.mkdir(module_dir)
dest_path = os.path.join(module_dir, os.path.basename(modules[0]))
if os.path.exists(dest_path) is False:
module = modules[0]
shutil.copy(module, module_dir)
shutil.copy(module, dest_path)
management.call_command(cmd, "register", source=module)
else:
logger.info("Not loading {0} from package. Extension already exists".format(modules[0]))
Expand Down

0 comments on commit 4547d12

Please sign in to comment.