Skip to content

Commit

Permalink
Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanblock committed Sep 20, 2023
1 parent 75738bd commit e32838f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/client-factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,11 @@ module.exports = async function clientFactory (config, creds, region) {
}
catch (err) {
if (hasEsmError(err)) {
let path = process.platform.startsWith('win')
? 'file://' + pluginName
: pluginName
let path = pluginName
if (process.platform.startsWith('win')) {
try { require.resolve(path) }
catch { path = 'file://' + pluginName }
}
let mod = await import(path)
plugin = mod.default ? mod.default : mod
}
Expand Down

0 comments on commit e32838f

Please sign in to comment.