[PCPlugin] Rewrite original JS code and use relative path
This commit is contained in:
parent
d075c67250
commit
db3fda3dd6
|
@ -4,7 +4,7 @@ export default (manifestPath, repo) => {
|
||||||
const pcManifest = JSON.parse(readFileSync(manifestPath, 'utf8'));
|
const pcManifest = JSON.parse(readFileSync(manifestPath, 'utf8'));
|
||||||
|
|
||||||
let manifest = {
|
let manifest = {
|
||||||
main: 'index.js',
|
main: '../index.js',
|
||||||
tags: ['port'],
|
tags: ['port'],
|
||||||
|
|
||||||
name: pcManifest.name,
|
name: pcManifest.name,
|
||||||
|
@ -22,5 +22,5 @@ export default (manifestPath, repo) => {
|
||||||
const jsCode = content.replace(`module.exports = class`, `export default new class`).replace(/{ *Plugin *}/, `{ Plugin, powercord }`);
|
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