mirror of
https://github.com/smartfrigde/armcord.git
synced 2024-08-14 23:56:58 +00:00
23 lines
695 B
JavaScript
23 lines
695 B
JavaScript
const fs = require("fs");
|
|
const { app, session } = require("electron");
|
|
const electron = require("electron");
|
|
const path = require ('path');
|
|
const execPath = path.dirname (process.execPath);
|
|
app.whenReady().then(() => {
|
|
fs.readdirSync(`${execPath}/resources/mods/`).forEach((file) => {
|
|
try {
|
|
const manifest = fs.readFileSync(
|
|
`${execPath}/resources/mods/${file}/manifest.json`,
|
|
"utf8"
|
|
);
|
|
var pluginFile = JSON.parse(manifest);
|
|
session.defaultSession.loadExtension(`${execPath}/resources/mods/${file}`);
|
|
console.log(
|
|
`%cLoaded ${pluginFile.name} made by ${pluginFile.author}`,
|
|
"color:red"
|
|
);
|
|
} catch (err) {
|
|
console.error(err);
|
|
}
|
|
});
|
|
});
|