Skip to content

Commit

Permalink
Fix "modules/" path in moduleDownloader
Browse files Browse the repository at this point in the history
  • Loading branch information
Elanis committed Aug 5, 2023
1 parent 1be6867 commit e9f3b71
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions moduleDownloader.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ export default class ModuleDownloader {
}

static async install(moduleData, chosenTag) {
let directoryList = await readdir('./resources/app/modules/');
let directoryList = await readdir(global.modulesPath);

// Module already exists
const modulePath = path.join('./resources/app/modules/', moduleData.name);
const modulePath = path.join(global.modulesPath, moduleData.name);
const moduleConfigPath = path.join(modulePath, 'module.json');
let moduleConfig = {};
if(directoryList.includes(moduleData.name)) {
Expand All @@ -49,7 +49,7 @@ export default class ModuleDownloader {

if(moduleData.desktop.module || moduleData.desktop.window) {
// Download module
const zipPath = path.join('./resources/app/modules/', moduleData.name + '.zip');
const zipPath = path.join(global.modulesPath, moduleData.name + '.zip');
await (new Promise((resolve, reject) => {
const file = createWriteStream(zipPath);
ModuleDownloader.download(file, moduleData.download_url, resolve);
Expand Down Expand Up @@ -109,10 +109,10 @@ export default class ModuleDownloader {
}

static async uninstall(moduleName) {
const directoryList = await readdir('./resources/app/modules/');
const directoryList = await readdir(global.modulesPath);

// Module already exists
const modulePath = path.join('./resources/app/modules/', moduleName);
const modulePath = path.join(global.modulesPath, moduleName);
const moduleConfigPath = path.join(modulePath, 'module.json');

if(directoryList.includes(moduleName)) {
Expand Down

0 comments on commit e9f3b71

Please sign in to comment.