1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
diff --git a/src/Powercord/apis/commands.js b/src/Powercord/apis/commands.js
index a8239208..4d5b3ce5 100644
--- a/src/Powercord/apis/commands.js
+++ b/src/Powercord/apis/commands.js
@@ -52,8 +52,8 @@ class CommandsAPI extends API {
*/
registerCommand (command) {
// @todo: remove this once there's a proper implemention (if any) for fetching the command origin.
- const stackTrace = (new Error()).stack;
- const [ , origin ] = stackTrace.match(new RegExp(`${global._.escapeRegExp(powercord.pluginManager.pluginDir)}.([-\\w]+)`));
+ // const stackTrace = (new Error()).stack;
+ // const [ , origin ] = stackTrace.match(new RegExp(`${global._.escapeRegExp(powercord.pluginManager.pluginDir)}.([-\\w]+)`));
if (typeof command === 'string') {
console.error('no');diff --git a/src/Powercord/managers/plugins.js b/src/Powercord/managers/plugins.js
index 2bb7beaf..ef13b4ad 100644
--- a/src/Powercord/managers/plugins.js
+++ b/src/Powercord/managers/plugins.js
@@ -5,9 +5,11 @@ const { rmdirRf } = require('powercord/util');
const { exec } = require('child_process');
const security = require('./security.js');
+const XDG_DATA_HOME = process.env.XDG_DATA_HOME || join(process.env.HOME, '.local', 'share');
+
module.exports = class PluginManager {
constructor () {
- this.pluginDir = resolve(__dirname, '..', 'plugins');
+ this.pluginDir = resolve(XDG_DATA_HOME, 'powercord', 'plugins');
this.plugins = new Map();
this.manifestKeys = [ 'name', 'version', 'description', 'author', 'license' ];
|