Skip to content

Commit

Permalink
Fix plugin import in Windows
Browse files Browse the repository at this point in the history
Change workflow name of benchmark
  • Loading branch information
ryanblock committed Sep 20, 2023
1 parent 75738bd commit 8423a99
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Node CI
name: Benchmark

# Push tests pushes; PR tests merges
on: [ push ]
Expand Down
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 { path = 'file://' + require.resolve(path) }
catch { path = 'file://' + pluginName }
}
let mod = await import(path)
plugin = mod.default ? mod.default : mod
}
Expand Down

0 comments on commit 8423a99

Please sign in to comment.