diff options
-rw-r--r-- | src/app/browser.js | 2 | ||||
-rw-r--r-- | src/utils.js | 7 |
2 files changed, 5 insertions, 4 deletions
diff --git a/src/app/browser.js b/src/app/browser.js index ff9ec87..3631550 100644 --- a/src/app/browser.js +++ b/src/app/browser.js @@ -58,7 +58,6 @@ var Browser = { }, setbutton: (mod, string) => { mod = normalize(mod); - console.log(mod) if (document.getElementById(mod)) { let elems = document.querySelectorAll(`#${mod}`); @@ -136,7 +135,6 @@ function BrowserEl(properties) { ipcRenderer.on("removedmod", (event, modname) => { setButtons(true); - console.log("test" + modname) Browser.setbutton(modname, lang("gui.browser.install")); }) diff --git a/src/utils.js b/src/utils.js index 6c24aff..048e0e6 100644 --- a/src/utils.js +++ b/src/utils.js @@ -448,6 +448,9 @@ const mods = { if (fs.existsSync(path.join(mod, "mod.json")) && fs.statSync(path.join(mod, "mod.json")).isFile()) { + if (fs.existsSync(path.join(modpath, modname))) { + fs.rmSync(path.join(modpath, modname), {recursive: true}); + } copy(mod, path.join(modpath, modname)) return installed(); @@ -473,9 +476,9 @@ const mods = { let cache = path.join(app.getPath("userData"), "Archives"); if (fs.existsSync(cache)) { fs.rmSync(cache, {recursive: true}); - fs.mkdirSync(cache); + fs.mkdirSync(path.join(cache, "mods"), {recursive: true}); } else { - fs.mkdirSync(cache); + fs.mkdirSync(path.join(cache, "mods"), {recursive: true}); } try { |