hubot 5.0.3 → 5.0.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/robot.js +3 -2
package/package.json
CHANGED
package/src/robot.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
const EventEmitter = require('events').EventEmitter
|
|
3
3
|
const fs = require('fs')
|
|
4
4
|
const path = require('path')
|
|
5
|
+
const pathToFileURL = require('url').pathToFileURL
|
|
5
6
|
|
|
6
7
|
const async = require('async')
|
|
7
8
|
const pino = require('pino')
|
|
@@ -510,9 +511,9 @@ class Robot {
|
|
|
510
511
|
if (Array.from(HUBOT_DEFAULT_ADAPTERS).indexOf(this.adapterName) > -1) {
|
|
511
512
|
this.adapter = this.requireAdapterFrom(path.resolve(path.join(__dirname, 'adapters', this.adapterName)))
|
|
512
513
|
} else if (['.js', '.cjs', '.coffee'].includes(ext)) {
|
|
513
|
-
this.adapter = this.requireAdapterFrom(path.resolve(adapterPath))
|
|
514
|
+
this.adapter = this.requireAdapterFrom(pathToFileURL(path.resolve(adapterPath)).pathname)
|
|
514
515
|
} else if (['.mjs'].includes(ext)) {
|
|
515
|
-
this.adapter = await this.importAdapterFrom(path.resolve(adapterPath))
|
|
516
|
+
this.adapter = await this.importAdapterFrom(pathToFileURL(path.resolve(adapterPath)).href)
|
|
516
517
|
} else {
|
|
517
518
|
this.adapter = this.requireAdapterFrom(`hubot-${this.adapterName}`)
|
|
518
519
|
}
|