aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/modules/packages.js9
1 files 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) => {