Open solonovamax opened 3 years ago
I never truly gave attention to support for symlinked plugins, and given the current state of Powercord (maintenance, with bigger problems to worry about with Discord's roll out of forced context isolation), I don't know if this will ever be worked on, and the fix most likely will be v3 (since v3 core is very different from v2 core)
Oof, that's a pain.
I like keeping my dev environments all in the same place, so I can quickly find projects in intellij. (I keep all programming projects in ~/Programming/[Language Name]/*
)
And since there's no good way to set a custom plugin dir, I thought a symlink would be the best.
Alternatively, you could just add some simple way to add a dir that contains a plugin (Meaning, if the dir is /abcd/123/
, then it looks for /abcd/123/index.js
.), which is loaded along with the rest of the plugins.
(It doesn't have to be anything fancy, and should be devs only. So just make it a .json file somewhere, that holds a list of key:value pairings, where the key is the name and the value is the dir. It's hacky, but works. Or something like that.)
I'd like to add that it also breaks themes
Describe the bug
when registering a command from a folder that is not in the plugin directory (meaning, you created a symlink to an external directory), then powercord fails with this error:
To Reproduce
Create a symlink in your plugin dir to another dir Make a simple plugin that registers a command. The error will occur when the command is attempting to be registered. (Hell, the object passed to the
registerCommand
method can even be null, that will still cause the error.)Expected behavior
Powercord doesn't rely on directory hard path for command registration. Perhaps instead it could work like this: All the methods to register settings/commands use methods from the plugin class, and then the plugin class has a name that it registers. That way, it uses the name property instead of the hacky error trace code that can break. Or just use the stack trace, but then instead of matching with the plugin dir, it just replaces the plugin dir with an empty string, replaces
.
with/
, and then trims the first/
.Desktop (please complete the following information):
Additional context
Add any other context about the problem here.
Here is a link to the exact line on which it occurs.