Skip to content

Commit

Permalink
Fix function registration
Browse files Browse the repository at this point in the history
The sample function file and the docs both suggest
placing function.py files loose under /extensions/functions, e.g.
extensions/functions/foo.py.

The globbing pattern here was skipping over them, expecting
them instead at extensions/functions/foo/foo.py.
  • Loading branch information
jacobtylerwalls committed Nov 20, 2023
1 parent 09d5008 commit ced7635
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion arches/management/commands/packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -797,7 +797,10 @@ def load_extensions(package_dir, ext_type, cmd):
else:
logger.info("Not loading {0} from package. Extension already exists".format(components[0]))

modules = glob.glob(os.path.join(extension, "*.json"))
modules = []
if not os.path.isdir(extension):
modules.extend(extension)
modules.extend(glob.glob(os.path.join(extension, "*.json")))
modules.extend(glob.glob(os.path.join(extension, "*.py")))

if len(modules) > 0:
Expand Down

0 comments on commit ced7635

Please sign in to comment.