[PCCompat] Use powercord import instead of window global
This commit is contained in:
parent
ac3778e574
commit
d94d7bfc42
|
@ -1,6 +1,6 @@
|
||||||
// Also set Powercord global var stuff here since entities import is needed to use Plugin (which every PC plugin uses)
|
// Also set Powercord global var stuff here since entities import is needed to use Plugin (which every PC plugin uses)
|
||||||
|
|
||||||
window.powercord = {
|
export const powercord = {
|
||||||
api: {
|
api: {
|
||||||
commands: {
|
commands: {
|
||||||
registerCommand: ({ command, alias, description, usage, executor }) => {
|
registerCommand: ({ command, alias, description, usage, executor }) => {
|
||||||
|
|
|
@ -19,7 +19,7 @@ export default (manifestPath, repo) => {
|
||||||
|
|
||||||
const content = readFileSync(pcManifest.main || 'index.js', 'utf8');//.replace(/\\/g, '\\\\').replace(/`/g, '\\`');
|
const content = readFileSync(pcManifest.main || 'index.js', 'utf8');//.replace(/\\/g, '\\\\').replace(/`/g, '\\`');
|
||||||
|
|
||||||
const jsCode = content.replace(`module.exports = class`, `export default new class`);
|
const jsCode = content.replace(`module.exports = class`, `export default new class`).replace(/{ *Plugin *}/, `{ Plugin, powercord }`);
|
||||||
|
|
||||||
writeFileSync(`${manifestPath}/goosemodModule.json`, JSON.stringify(manifest));
|
writeFileSync(`${manifestPath}/goosemodModule.json`, JSON.stringify(manifest));
|
||||||
writeFileSync(`${manifestPath}/index.js`, jsCode);
|
writeFileSync(`${manifestPath}/index.js`, jsCode);
|
||||||
|
|
Loading…
Reference in New Issue