Skip to content

Commit f7ef2dc

Browse files
committed
Fallback to fullpath on Windows
1 parent 30296f3 commit f7ef2dc

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

index.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,16 @@ function getPluginEntry(pluginDir, pluginName = "mpvjs.node") {
2929
const fullPluginPath = path.join(pluginDir, pluginName);
3030
// Try relative path to workaround ASCII-only path restriction.
3131
let pluginPath = path.relative(process.cwd(), fullPluginPath);
32-
// "./plugin" is required only on Linux.
33-
if (process.platform === "linux" && path.dirname(pluginPath) === ".") {
34-
pluginPath = `.${path.sep}${pluginPath}`;
32+
if (path.dirname(pluginPath) === ".") {
33+
// "./plugin" is required only on Linux.
34+
if (process.platform === "linux") {
35+
pluginPath = `.${path.sep}${pluginPath}`;
36+
}
37+
} else {
38+
// Relative plugin paths doesn't work on Windows.
39+
if (process.platform === "win32") {
40+
pluginPath = fullPluginPath;
41+
}
3542
}
3643
if (containsNonASCII(pluginPath)) {
3744
throw new Error("Non-ASCII plugin path is not supported");

0 commit comments

Comments
 (0)