Support symbolic links to modules

Ignore files instead checking if the entry is a directory looking for
modules to patch in.  This is to support symbolic link to modules.
This commit is contained in:
Hornwitser committed 2021-05-15 23:22:37 +02:00
1 parent 0ae4fa0d2e
commit e94662350a
1 file changed
+1 -1
+1 -1
View File
@@ -453,7 +453,7 @@ class Instance extends libLink.Link {
// Find stand alone modules to load
// XXX for now only the included clusterio module is loaded
for (let entry of await fs.readdir(path.join(__dirname, "modules"), { withFileTypes: true })) {
if (entry.isDirectory()) {
if (!entry.isFile()) {
if (modules.has(entry.name)) {
throw new Error(`Module with name ${entry.name} already exists in a plugin`);
}