Skip to content

Commit 4e0b21b

Browse files
committed
Fix #1102
Also fix loading plugins, the `load` function wouldn't be called correctly.
1 parent 637b51f commit 4e0b21b

File tree

3 files changed

+16
-13
lines changed

3 files changed

+16
-13
lines changed

package-lock.json

Lines changed: 12 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"@types/minimatch": "3.0.3",
3434
"fs-extra": "^8.1.0",
3535
"handlebars": "^4.5.3",
36-
"highlight.js": "^9.16.2",
36+
"highlight.js": "^9.17.1",
3737
"lodash": "^4.17.15",
3838
"marked": "^0.7.0",
3939
"minimatch": "^3.0.0",
@@ -48,7 +48,7 @@
4848
"@types/marked": "^0.7.2",
4949
"@types/mocha": "^5.2.7",
5050
"@types/mockery": "^1.4.29",
51-
"@types/node": "^12.12.12",
51+
"@types/node": "^12.12.17",
5252
"@types/shelljs": "^0.8.6",
5353
"mocha": "^6.2.2",
5454
"mockery": "^2.1.0",

src/lib/utils/plugins.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export class PluginHost extends AbstractComponent<Application> {
5050
: instance // support legacy plugins
5151
;
5252
if (typeof initFunction === 'function') {
53-
instance(this);
53+
initFunction(this);
5454
logger.write('Loaded plugin %s', plugin);
5555
} else {
5656
logger.error('Invalid structure in plugin %s, no function found.', plugin);
@@ -98,7 +98,7 @@ export class PluginHost extends AbstractComponent<Application> {
9898
const candidates: string[] = [];
9999
FS.readdirSync(basePath).forEach((name) => {
100100
const dir = Path.join(basePath, name);
101-
if (name.startsWith('@')) {
101+
if (name.startsWith('@') && FS.statSync(dir).isDirectory()) {
102102
FS.readdirSync(dir).forEach((n) => {
103103
candidates.push(Path.join(name, n));
104104
});

0 commit comments

Comments
 (0)