From cf83f8fd648dab4eb905ea81dd258160f8b95d33 Mon Sep 17 00:00:00 2001 From: 0neGal Date: Sun, 16 Jul 2023 19:11:26 +0200 Subject: minor changes to packages.install() --- src/modules/packages.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/modules/packages.js b/src/modules/packages.js index 4410192..bb610d5 100644 --- a/src/modules/packages.js +++ b/src/modules/packages.js @@ -209,16 +209,19 @@ packages.install = async (url, author, package_name, version) => { } } + // removes older version of package inside the `packages` folder packages.remove(author, package_name, version); console.log("Moving package:", name); let moved = packages.move(package_path); - if (moved) { - console.log("Installed package:", name); - } else { + if (! moved) { console.log("Moving package failed:", name); + return false; } + + console.log("Installed package:", name); + return true; } packages.download = async (url, name) => { -- cgit v1.2.3