@mantiq/cli 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/Kernel.ts +8 -2
package/package.json
CHANGED
package/src/Kernel.ts
CHANGED
|
@@ -37,8 +37,14 @@ export class Kernel {
|
|
|
37
37
|
try {
|
|
38
38
|
const mod = await import(dir + '/' + file)
|
|
39
39
|
for (const exported of Object.values(mod)) {
|
|
40
|
-
if (typeof exported
|
|
41
|
-
|
|
40
|
+
if (typeof exported !== 'function') continue
|
|
41
|
+
try {
|
|
42
|
+
const instance = new (exported as any)()
|
|
43
|
+
if (instance.name && typeof instance.handle === 'function') {
|
|
44
|
+
this.register(instance)
|
|
45
|
+
}
|
|
46
|
+
} catch {
|
|
47
|
+
// Not instantiable or not a command
|
|
42
48
|
}
|
|
43
49
|
}
|
|
44
50
|
} catch {
|